我是python的初学者。我很困惑替换刺痛。假设我有一封邀请函。如何编写可以询问用户名的程序。和文字将以这个名字出来。帮助将不胜感激
答案 0 :(得分:2)
'Hello yourname, welcome to stackoverflow. You should choose a friendly name'.replace('yourname', 'thank u')
'Hello thank u, welcome to stackoverflow. You should choose a friendly name'
答案 1 :(得分:0)
person = input('Enter your name: ')
print('Hello', person)