我想在python脚本中为我的字符串提供一个模式。
我的意思是这样的:
x = "hello" + anyString
注意:这个anyString
可以是任何东西,甚至什么都不是
更新:
在这段代码中,我想在字符串的末尾键入任何内容并得到相同的结果
userCommand = input("you> ")
if userCommand == "hello":
print("hi!")
结果:
you> hello
hi!
当我在hello之后键入其他内容时,我希望得到相同的结果,比如:hello!
Tags:
相关问题 更多 >
编程相关推荐