Skip to content

Latest commit

 

History

History
94 lines (62 loc) · 2.04 KB

README.md

File metadata and controls

94 lines (62 loc) · 2.04 KB

Python Fundamentals

This script covers the basics of Python including:

  • Variables and Data Types
  • Lists
  • Tuples
  • Dictionaries
  • Control Flow
  • Loops
  • Functions
  • Classes

Python Variables and Data Types

This script demonstrates the use of various variables and data types in Python. It includes:

  • Integer
  • Floating point
  • String
  • Boolean
  • List
  • Tuple
  • Dictionary

Python Basic Math Operations

This script demonstrates the use of basic math operations in Python. It includes:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Modulus
  • Exponentiation
  • Floor division

Each operation is performed on two variables, a and b, which are set to 10 and 20 respectively.

How to Run

You can run the script by using the following command in your terminal:

python3 mathbasic.py

Python Methods

This script demonstrates the importance of methods in Python.

Methods allow us to write a piece of code once and reuse it, which makes our code more organized and easier to maintain.

In this script, we create a method greet_user that greets a user. We then use this method to greet three different users.

How to Run

You can run the script by using the following command in your terminal:

python3 methods.py

Python Classes

This script demonstrates the importance of classes in Python.

Classes allow us to define a blueprint for an object, which we can then use to create as many objects as we want. This makes our code more organized and easier to maintain.

In this script, we create a Car class with a name, a color, and a start method. We then use this class to create two cars and start them.

How to Run

You can run the script by using the following command in your terminal:

python3 classes.py

Python Loops

This script demonstrates the different types of loops in Python. It includes:

  • For loop
  • While loop
  • Nested loops
  • Loop control statements (break and continue)

How to Run

You can run the script by using the following command in your terminal:

python3 loops.py