Python Input Output

Practice more Python I/O exercises here: Click Here

Python इनपुट/आउटपुट अभ्यास के लिए: यहाँ क्लिक करें

Python Input/Output Practice

Python इनपुट/आउटपुट अभ्यास

These exercises help beginners understand how to take input from users and display outputs using Python. Practice with strings, numbers, and formatted outputs.

ये अभ्यास शुरुआती लोगों को सिखाते हैं कि Python में उपयोगकर्ता से इनपुट कैसे लिया जाए और आउटपुट कैसे दिखाया जाए। स्ट्रिंग, नंबर और फॉर्मेटेड आउटपुट के साथ अभ्यास करें।

Take Name Input
Input Name
# Take name input
name = input("Enter your name: ")
print("Hello " + name + "! Welcome to Python.")

This program asks the user for their name and prints a greeting message.

यह प्रोग्राम उपयोगकर्ता से नाम पूछता है और एक स्वागत संदेश दिखाता है।

Add Two Numbers
Add Numbers
# Input two numbers and add
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
sum = num1 + num2
print("Sum is:", sum)

Practice adding two numbers from user input and displaying the result.

उपयोगकर्ता इनपुट से दो नंबर जोड़ने और परिणाम दिखाने का अभ्यास करें।

Formatted Output
Formatted Output
# Formatted output
name = input("Enter your name: ")
age = int(input("Enter your age: "))
print(f"Hello {name}, you are {age} years old.")

Learn how to display outputs using formatted strings for better readability.

बेहतर पठनीयता के लिए फॉर्मेटेड स्ट्रिंग का उपयोग करके आउटपुट दिखाना सीखें।

Enjoyed this Python I/O guide? Share with your network!