python - input
input
How the input function works in Python :
- When
input()
function executes program flow will be stopped until the user has given an input. - The text or message display on the output screen to ask a user to enter input value is optional i.e. the prompt, will be printed on the screen is optional.
- Whatever you enter as input, input function convert it into a string. if you enter an integer value still
input()
function convert it into a string.
在if的语句中如果不转换的话,会提示错误:
Taking multiple inputs from user in Python