Introduction to Python

Python is a high-level, interpreted, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.

sudo apt install python3

Or download from python.org.

if a > b:
print("a is greater than b")
elif a == b:
print("a is equal to b")
else:
print("a is less than b")
for i in range(5):
print(i)
while a < 10:
a += 1
def greet(name):
return f"Hello, {name}!"
with open("test.txt", "r") as file:
for line in file:
print(line)
class Person:
def __init__(self, name):
self.name = name
def greet(self):
print(f"Hello, my name is {self.name}")
p = Person("Sai")
p.greet()