New course! Every coder should learn Generative AI!
Try a free lesson+ 2
What's <stdin> in the language?
I'm real-time novice in programming stuff but I find badly wanting to learn it.
1 Answer
+ 1
It is standard input and used when you want python to get a value from user.
With input function you can do that and save user input in a variable.It gets a string as a parameter. The string will be shown when the program wants to get the value.
for example:
>>> num=input("Enter a number:")
Python prints "Enter a number" and input will be saved in num variable until user presses enter.
The given value is string but you can convert it to other data types.