Introduction to Python
Python is an interpreted, high-level programming language known for its readability and versatile usage—from web development and data science to automation and AI.
- Easy-to-read syntax
- Large standard library
- Backed by vast community ecosystems
- Widely used in education and industry
Example 1: Hello World
print("Hello, World!")
Run Code on OneCompiler
Example 2: Addition
a = 5
b = 3
print("Sum =", a + b)
Run Code on OneCompiler
Example 3: Loop
for i in range(1, 6):
print(i)
Run Code on OneCompiler
Example 4: Function
def multiply(x, y):
return x * y
print("Product =", multiply(4, 5))
Run Code on OneCompiler