Accepting inputs from command terminal

Accepting inputs from command terminal

input() function is used to accept input from command terminal.

k = input("Enter your name:")
print(k)

----------------------------------

When above code is run, following prompt shall be seen,

Enter your name:

Type in the name and press enter and the same shall be printed on the terminal.
Snapshot of output below.

Post a Comment

0 Comments