在学习input时,print() 只显示一个,这是什么情况?

请教:为什么我调用print(),却只显示一行?

讨论数量: 2

em,这是 input 在等待输入吧?

3年前 评论

如同一楼所说,因为你用input,那么print的内容需要你输入一些东西之后,方可显现。当前打印的只是你写在input内的提示语。

input的定义

input([prompt])
    If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. 
3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!