Input output string

To read input from the console, python has one single power full function input(), The input() function can be used to read any type of the data from the console, as It returns string data after reading from the console.

Output String

You can directly print a string value to the console using the print() function without specifying its data-type

See also: Python program to print to console

Program

# Take input from user
name = input("Enter your name : ")

# Just print it
print("\nHello", name)

Output

Enter your name : Karan
Hello Karan