? Python History
? Python History
🔹 Key Milestones:
Guido named it after the British comedy show "Monty Python's Flying Circus", not the snake 🐍.
✅ 1. Install Python
🔗 Download: https://www.python.org/downloads
bash
CopyEdit
python --version
bash
CopyEdit
python
Then type:
python
CopyEdit
print("Hello, World!")
👉 Using a File:
python
CopyEdit
print("Hello, World!")
Run it:
bash
CopyEdit
python hello.py
🟦 Variables in Python
✅ What is a Variable?
✨ Creating Variables
x=5 # integer
# Example 1
a = 10
b = 20
c=a+b
print("Sum:", c)
Output: Sum: 30
# Example 2
user = "Alice"
age = 23
x = 10
x = "Ten"
Python is dynamically typed, so variables can hold any type of value at different times.
3. 🧠 Multiple Assignments
a, b, c = 1, 2, 3
print(a, b, c)
x = y = z = 100
MY PRACTICE:
OUTPUT:
print() Function in Python — Focus on sep and end
✅ Syntax:
🔍 Examples:
python
CopyEdit
By default, print() ends with a newline (\n), which moves the output to the next line.
✅ Syntax:
🔍 Examples:
✅ Combined Example:
print("C")
# Output: A:B --> C
🧪 Quick Practice:
print("Go")
💬 Answer:1-2-3|Go
Hard Challenge 1
for i in range(3):
print("Done")
Output:
Examples:
x = True
y = False
print(2 == 3) # False
if x:
print("x is True")
if not y:
print("y is False")
Internally:
Example:
print(True + 1) # 2
print(False + 5) # 5