一、input() 函数
1、input() 基本用法
input() 函数让程序暂停运行,等待用户输入一些文本。不管输入的是什么内容,程序通过 input() 得到的始终是 字符串 类型,使用方法如下:
message = input('Tell me something, and I will repeat it to you:')
print(message)
结果:
Tell me something, and I will repeat it to you:hello everyone
hello everyone
注意:在使用 input() 函数的时候,最终的目的是通过提示让用户输入我们想要的内容,因此,我们需要把要求写的清楚一点
Tips: 在 input() 的提示末尾加一个空格,将提示与输入内容分开,让用户知道自己的输入始于何处。
2、input() 多行提示
有时候我们
prompt = "If you tell us who you are, wo can personalize the maeeage yo