In this video of the Python Full Course in Hindi 2025, we’ll explore how to interact with users through input and output, store their responses, and format the output professionally.
Whether you're a beginner or revisiting Python, this lesson will give you a clear understanding of how data flows into and out of a Python program — all explained in Hindi with examples and a mini practice challenge.
-Converting input types using int(), float(), etc.
This video will help you make your Python programs more interactive and user-friendly. Don’t skip the mini challenge at the end — it will boost your practice.
# -------------------------------
# Python Day 3 - Basic Input & Output
# Mohit Decodes | Learn Python in Hindi
# -------------------------------
# ✅ 1️⃣ Display Output using print()
print("Welcome to Mohit Decodes Python Course!")
print("This is Day 3 - Basic Input & Output")
# ✅ 2️⃣ Writing Comments
# Single line comment in Python starts with #
# Example:
# This program demonstrates input and output in Python
# ✅ 3️⃣ Taking Input from User
name = input("Enter your name: ")
print("Hello,", name)
# ✅ 4️⃣ Input Always Comes as String
# Let's verify it using type()
age = input("Enter your age: ")
print("Data type of age before conversion:", type(age))
# ✅ 5️⃣ Type Conversion (string → int)
age = int(age)
print("After conversion, type of age is:", type(age))
# ✅ 6️⃣ Taking multiple inputs
city = input("Enter your city: ")
profession = input("Enter your profession: ")
# ✅ 7️⃣ Different ways to format output
# (a) Using comma
print("Hi", name, "from", city, "you are a", profession, "and your age is", age)
# (b) Using string concatenation
print("Hi " + name + " from " + city + ", you are a " + profession + " and your age is " + str(age))
# (c) Using f-string (Python 3.6+)
print(f"Hi {name} from {city}, you are a {profession} and your age is {age}")
# (d) Using format() method
print("Hi {} from {}, you are a {} and your age is {}".format(name, city, profession, age))
# ✅ 8️⃣ Mini Practice Challenge
# Write a small interactive script that asks:
# - your name
# - your favorite language
# - your dream company
# and display formatted output
print("\n🧠 Mini Practice Challenge 🧠")
fav_lang = input("Enter your favorite programming language: ")
dream_company = input("Enter your dream company: ")
print(f"Hello {name}! You love {fav_lang} and want to work at {dream_company}. Keep learning and coding 🚀")