1、python 输入输出框架
input():括号里是输入提示信息,而不是输入的写输入的内容。
在pycharm中,
str = input(" Please input a string:")
print("str is ",str)
具体输入是在 下面运行框里。(如下 输入hello的位置)
注意输入的类型
python input 的输出是字符串
若需要输出整型,浮点型,需要改类型
#输入的数字为字符串
age = input("What is your age? ")
print(age, type(age))
#输入的数字为字符串,然后被**int转换为整数**
lucky_number = int(input("What is your lucky number? "))
print(lucky_number, type(lucky_number))
#输入的数字为字符串,然后被**float转换为浮点数**
easy_math = float(input("What is 3.14 * 2? "))
print(easy_math, type(easy_math))
1、print(r"\nwoow")
A.WOOW B.r"\nwoow" C.\nwoow D.woow E.nwoow
解析