Python Full Guide
Python Full Guide
Key Features:
print("Hello, World!")
1
Explanation:
x = 5
name = "Alice"
Type Example
int x = 10
float pi = 3.14
2
Chapter 3: Operators
3.1 Arithmetic Operators
+ - * / // % **
and or not
= += -= *= /= %= **= //=
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
4.2 Loops
for Loop
for i in range(5):
print(i)
3
while Loop
x = 0
while x < 5:
print(x)
x += 1
for i in range(5):
if i == 3:
break
print(i)
Chapter 5: Functions
5.1 Defining Functions
def greet(name):
print("Hello, " + name)
def greet(name="Guest"):
print("Hello, " + name)
More chapters to come: OOP, file handling, modules, exceptions, advanced Python, projects, and more.