(新)python 个关于用户输入的问题
(new) python questions about user input
好的,我有一个关于用户输入的问题,这很简单,而且我是新手
所以..我正在使用 python 3.3 如果我输入
input("Enter name and age: ")
如何将记录姓名和年龄的 if 语句放在一起并告诉用户:
print("Your name is this and your age is that")
使用他们插入的值,
PS,我使用 notepad++ 作为 IDE
和 cmd 输入代码。
所以没有 python 炮弹。
提前致谢,请详细解释你的答案是如何工作的
因为我是 python 的新手,我之前一直在使用 actionscript 编写脚本
但它太过时了,所以我知道一些关于循环的两件事,但我从来没有真正编写过可以记录的输入数据的脚本。
提前致谢。
name, age = input("Enter name and age: ").split()
print("Your name is {this} and your age is {that}".format(this=name, that=age))
好的,我有一个关于用户输入的问题,这很简单,而且我是新手 所以..我正在使用 python 3.3 如果我输入
input("Enter name and age: ")
如何将记录姓名和年龄的 if 语句放在一起并告诉用户:
print("Your name is this and your age is that")
使用他们插入的值, PS,我使用 notepad++ 作为 IDE 和 cmd 输入代码。 所以没有 python 炮弹。 提前致谢,请详细解释你的答案是如何工作的 因为我是 python 的新手,我之前一直在使用 actionscript 编写脚本 但它太过时了,所以我知道一些关于循环的两件事,但我从来没有真正编写过可以记录的输入数据的脚本。
提前致谢。
name, age = input("Enter name and age: ").split()
print("Your name is {this} and your age is {that}".format(this=name, that=age))