python - input

 

 

 

python - input

 

 

 

 

 

python - 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的语句中如果不转换的话,会提示错误:

 

python - input

 

上一篇:2021-10-05


下一篇:实验二:熟悉常用的HDFS操作