赞
踩
python—做一个恶搞程序
very easy
print("You can't win this game") #你不可能赢这个游戏
n = int(input("Between 1 and 10 type a number(integer)")) #在1到10之间写一个数字(整数)
print("Your answer isn't integer or not between 1 and 10,this game is over.") #你的回答不是整数或者1到10之间的一个数字(整数)
输入&输出:
Your answer isn’t integer or not between 1 and 10,this game is over.
easy
while True:
n = input("我现在心里想的啥?")
print("猜错咯")
normal
try:
ln = []
for i in range(99):
n = int(input("Between 1 and 99 choose a number"))
if n == 100:
break
ln.append(n)
except:
print("Your answer isn't integer,this game is over.")
print("At last...")
print(ln)
print("Your answer have not 100!!!")
print("this game is over.")
你是不是想试试呢,别急,我们看一下这些的共同之处:他们都有一些不得不运行的程序,这些代码就是“坑”,他们想了好几种方案让你入“坑”,所以他们会列举你们跳“坑”失败的所有结果,他们都会在代码里解除这种结果,让你们只能跳坑。
尝试时间
想不想来尝试一下呢?别急,把下面这几段话看完。
标准
标准:是下面这段简单的代码
while True:
n = input("你在干啥?")
print("你是不是在干",n)
1
2
3
超easy,对吧
评分规则
开始50分
E:0—59(不及格)
D:60—70(及格)
C:71—80(一般)
B:81—90(良好)
A:91—99.5(优秀)
A+:100(满分)
满分100分
成功跳“坑”-50分
比标准代码多2行+1分(不允许垃圾代码)
用一个库+3分(只导入不用没用)
for、死循环+0.5分
用两个及以上个input命令+0.5分(只定义不用没用)
if True等垃圾代码-2分
用一个库+2分(只定义不用没用)
用一个函数+1.5分(只定义不用没用)
成功入“坑”+10分
在while False;if False;for i in range(0)等不可能执行代码嵌套1行-1.5分
程序出错-50分
————————————————
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。