|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我仿照小甲鱼第二节课的例子做的, 可是不知道为什么if语句后的那一句出不来,else后面的和结束语一起跑出来了,输什么进去都是一样的。我改怎么改啊???
- print('-----------------------------------------------------------------------')
- words = input('what is your name? :')
- guess = input(words)
- if guess == Jack:
- print('nice to see you')
- else:
- print('who are you?')
- print('bye bye')
复制代码
- print('-----------------------------------------------------------------------')
- words = input('what is your name? :')
- if words == "Jack":
- print('nice to see you')
- else:
- print('who are you?')
- print('bye bye')
复制代码
楼主参考:
1. Jack 为字符串,需引号;
2. 无需定义guess变量了~~
|
|