1.
Arithmetic Operators in Python:
o Python supports various arithmetic operators for mathematical operations:
Addition (+): Adds two numbers.
Subtraction (-): Subtracts one number from another.
Multiplication (*): Multiplies two numbers.
Division (/): Divides one number by another.
2. Input and Output in Python:
o To take input from users, you can use the input() function. It reads a line
from the keyboard and returns it as a string.
Example:
Python
name = input("Enter your name: ")
print("Hello, " + name)
o To display output, use the print() function. You can format the output using
placeholders or f-strings.
Example:
Python
x = 5
print("The value of x is", x)
3. Data Types in Python:
o Python has several built-in data types:
Numeric Types: int, float, complex
Text Type: str
Binary Types: bytes, bytearray, memoryview
None Type: NoneType
o You can check the data type of any object using the type() function.
Example:
Python
x = 20
print(type(x)) # Output: <class 'int'>
4. Scratch vs. Python:
o Scratch:
Block-based programming language suitable for younger students.
Great for creating art, games, and simple projects.
Enriched with hardware integration.
Takes up a lot of screen space for less programm
o Python:
Text-based programming language suitable for secondary students.
More complex but offers unlimited project potential.
Widely used at higher levels of education and in professional
settings.
Takes less screen space for more program which means that you can
make more complex programs
Green = a string
Grey= a comment
Orange = a number or a parameter (or a predefined property
name(for instance .length ))
Purple = special keyword (like var , if , else , etc)
Light-blue = operator ( + , - , * , / , = , < , == , && , etc)
Dark-blue = a predefined function name or the function name
in a function ...