Program to accept input from keyboard and display on the screen.
Use input() function to accept data from keyboard and assigned it to a variable str.
str = input('Enter any string: ')
Displaying the value of variable str on screen using print()
print(str)
Output
Enter any string: Hi This is Python Programming Language
Hi This is Python Programming Language
Complete code
str = input('Enter any string: ')
print(str)
Code 2 : Accepting input from keyboard and applying tab at the beginning of the string
Use input() function to accept data from keyboard
str = input('Enter any string: ')
Create a string variable and assign value \t escape character
a = '\t'
Display output using below print() statement
print(a,str)
Output
Enter any string: Hi This is the example of using escape characters
Hi This is the example of using escape characters
Above code add spaces at the beginning of the string.
Complete Code
str = input('Enter any string: ')
a = '\t'
print(a,str)