📜  如何在 python3 中获取输入 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:47.936000             🧑  作者: Mango

代码示例1
# An input is requested and stored in a variable
test_text = input ("Enter a number: ")

# Converts the string into a integer. If you need
# to convert the user input into decimal format,
# the float() function is used instead of int()
test_number = int(test_text)

# Prints in the console the variable as requested
print ("The number you entered is: ", test_number)