1:判断应用程序:input 1:询问用户名,然后输入
2:询问如何调用用户。输出:如果input 1包含input 2,那么欢迎,否则拒绝接受
示例:
你的名字:somebody
如何称呼你:body
welcome body!
题主您好,可以这样表示
ipt1 = input("你的名字:")
ipt2 = input("如何称呼你:")
if ipt2 in ipt1:
print(f"welcome {ipt2}")
else:
print("不欢迎,你走你走")
s1 = input('你的名字:')
s2 = input('如何称呼你:')
if s2 in s1:
print(f'welcome {s2}!')
else:
print('I don’t know you!')