Syntax :
Python
input("message")Example :
Python
name = input("Enter your name: ") print("Hello", name)
#output Enter your name: Rahul Hello Rahul Even if you enter a number, the value is stored as a string.
Converting Input to Integer :
Python
num1 = int(input("Enter a number: ")) num2 = int(input("Enter another number: ")) print("Sum =", num1 + num2) Converting Input to Float :
Python
price = float(input("Enter price: ")) print("Final Price =", price) Taking Multiple Inputs :
Python
a, b = input("Enter two numbers: ").split() print(a, b)