老年卡 一上车
小甲鱼
李金龙
甲鱼哥长得好像王自健,就我自己认为么?
secret = ['小甲鱼', '小鱿鱼', '翻車魚']
name = input("请输入你猜的人名:")
times = 2
while times :
times = times - 1
if name in secret :
print('恭喜你,答对了!')
break
else:
print('猜错了,请重新猜:')
name = input()
# -*- coding:utf-8 -*-
name = ['王老吉', '和其正', '加多宝']
has_name = []
i_name = input("请输入名字:\n")
count = 0
while True:
if i_name in name:
print("恭喜你猜对了")
break
else:
if i_name in has_name:
print("名字%s已经猜过了,重新输入一次吧~" % i_name)
else:
has_name.append(i_name)
print("猜错了,在猜一次吧~")
i_name = input()
看一下答案
小甲鱼
李金龙
真的是蒙的吗?
print('猜猜我是谁0v0')
a = ['大鱿鱼','小甲鱼','绿鲤鱼']
name = input('请输入一个名字:')
t = 3
whilet:
t = t - 1
if name in a:
print('我赛,你这么厉害呢')
break
else:
print('没关系,请从新猜一个把')
name = input('请输入一个名字:')
看看答案
C:\Python27\python.exe E:/11-自动化/python/demo/demo/guess.py
猜一猜我现在想的名字!
范围是-->[李总,李金龙,李爷爷]
输入名字:李总
Traceback (most recent call last):
File "E:/11-�Զ���/python/demo/demo/guess.py", line 17, in <module>
Input = input('输入名字:')
File "<string>", line 1
李总
^
SyntaxError: invalid syntax
进程已结束,退出代码1
迭代
递归
回复
好尴尬,李金龙是小甲鱼的真名吗- -
李爷爷?
Hell9 发表于 2017-7-7 00:20
好尴尬,李金龙是小甲鱼的真名吗- -
不是啊啊啊,你们不要瞎说
jf050108 发表于 2017-7-6 21:35
C:\Python27\python.exe E:/11-自动化/python/demo/demo/guess.py
猜一猜我现在想的名字!
范围是-->[李 ...
?我的代码有问题?