Powerful Language for AI, Web & Automation
Python is a simple, powerful programming language used in web development, AI, data science, automation, and more.
print("Hello Python")
name = "Sasank" age = 18 pi = 3.14
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
for i in range(5):
print(i)
def add(a, b):
return a + b
print(add(2, 3))
numbers = [1, 2, 3, 4]
for n in numbers:
print(n)
user = {
"name": "Sasank",
"role": "Developer"
}
print(user["name"])
class Car:
def __init__(self, model):
self.model = model
def drive(self):
print("Car is running")
c = Car("BMW")
c.drive()
file = open("data.txt", "w")
file.write("Hello Python")
file.close()