To use input() in Python we follow the syntax:
input([prompt])
To accept data from a user. With this function, a programmer can choose to display a prompt message for the users.
# input without a prompt
takeString = input()
print ('The message is :', takeString)
>>>Hi, how are you?
The message is: Hi, how are you?
# input with a prompt
takeString = input('What would you like to say?')
print ('The message is:', takeString)
>>> What would you like to say?
>>> Hi, how are you?
The message is: Hi, how are you?
Leave a Reply