用户:TAT查看:0 回复:3 评论:0 创建时间:2017-09-24T12:41:47
@技术喵
python在线编辑器中,当在线执行input时用户还没输入字符串就自动执行之后的语句了--
如:
name=input(‘please enter your name:’)
print(‘hello,%s’%name)
执行结果
hello,<unknown>
please enter your name:
喵,你的符号是中文的,换成英文后
name=input("please enter your name:")
print(hello,%s%name)
这个%号目前无法识别,你可以用下面这个替换
print('hello,'+name)
实现的效果就是系统会询问等你输入你的名字后才会输出('hello,你的名字)
具体有什么问题可以照技术喵 QQ:2950389506
点赞0
评论