🐍 Python Day 3 – Input & Output
🧠 Introduction
🐍 Python Day 3 – Input & Output
Ippati varaku manam variables & data types nerchukunnam.
Eroju manam user nundi input tiskoni output chupinchadam nerchukundam.
👉 Input = User nundi data tiskovadam
👉 Output = Screen meeda result chupinchadam
💡 Real-time applications lo idi chala important 🔥
📥 Taking Input (input())
print(name)
👉 User enter chesina value return avutundi
🔢 Number Input (Important ⚠️)
👉 Default ga input string ga untundi
age = input("Enter your age: ")
print(age)
👉 Correct way 👇
age = int(input("Enter your age: "))
print(age)
🧪 Example 1
age = int(input("Enter your age: "))
print("Hello", name)
print("You are", age, "years old")
➕ Example 2 (Addition)
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
sum = a + b
print("Sum is:", sum)
🎯 Output Example
Enter first number: 10
Enter second number: 20
Sum is: 30
📌 Key Points
👉 input() always string return chestundi
👉 Numbers kosam int() use cheyali
👉 Output kosam print() use chestam
🎯 Mini Practice
name = input("Enter your name: ")
course = input("Enter your course: ")
print("Welcome", name)
print("You are learning", course)
📌 Summary
✔ Output display chesam
✔ Numbers handle chesam
Comments
Post a Comment