Input from User in Python

User input in Python programming are used to take input from user, input() is one of the commonly used function to take input from user and proceed with that value.

Program Waiting for User Enter Value

Program

input("Enter a Key For Continue: ")
print("This is First Line")
input("Enter a Key Again For Continue: ")
print("This is Second Line")
input("Enter a Key For Exit: ")
Output
Enter a Key For Continue: Bilal
This is First Line
Enter a Key Again For Continue: Khan
This is Second Line
Enter a Key For Exit: Exit

Program User Enter Value Printing

Program

print("Enter Ur Name: ")
val = input() #user enter value assigning to 'val'.
print("The Entered Name is: ", val) #and printing.
 #you can also write like print("The Entered Name is: "+ val).
Output
Enter Ur Name:
Bilal Khan
The Entered Name is: Bilal Khan

Program User Enter Value Printing Another Method

Program

val = input("Enter Ur Name: ") #user enter value assigning to 'val'.
print("The Entered Name is: ", val) #and printing.
Output
Enter Ur Name: Bilal Khan
The Entered Name is: Bilal Khan

Program Concatenating User Enter Value and Printing
Program

val = input("Enter Ur Name: ") #user enter value assigning to 'val'.
print("Hello "+ val +"!") #and printing.
Output
Enter Ur Name: Bilal Khan Afridi
Hello Bilal Khan Afridi!