num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print(num1 + num2)Output:
30
🔹 12. Real-World Example
salary = float(input("Enter your monthly salary: "))
annual_salary = salary * 12
print(f"Your annual salary is {annual_salary}")🎯 Practice Questions
1. Take your name as input and print a welcome message.
2. Take two integers as input and print their sum.
3. Take a student's marks as input and print them using an f-string.
4. Take the radius of a circle as input and calculate the area.
5. Take your birth year as input and calculate your approximate age.
🎯 Key Takeaways
✅ Use print() to display output
✅ Use input() to accept user input
✅ input() always returns a string
✅ Convert input using int() or float() when needed
✅ Use f-strings for clean and readable output formatting
Double Tap ❤️ For More