#求助 在Codecademy学Python,有个习题不会做!

2013-11-08 11:25:55 +08:00
 hsumin
求助Python大大,教教小的,怎么修改,是Conditionals & Control Flow这一章的第15个习题

题目是这样的:
Write an if statement in the_flying_circus(). It must include:

and, or, or not;
==, !=, <, <=, >, or >=;
an if, elif, AND else statement;
it must return True when evaluated.

我的代码是这样的:
def the_flying_circus():
# Start coding here!
if 1 > 5:
return False
elif True and False != True:
return True
else:
return False
print the_flying_circus()
print the_flying_circus()
print the_flying_circus()
4336 次点击
所在节点    程序员
9 条回复
nodejx
2013-11-08 11:43:21 +08:00
def the_flying_circus():
# Start coding here!
if 1>0:
return (True or False and (not False))
elif False:

return True
else:
return True

the_flying_circus()

随手一些,貌似通过了。。。
acpp
2013-11-08 12:03:43 +08:00
@nodejx 头像有大图吗
nodejx
2013-11-08 12:33:19 +08:00
@acpp http://www.p1.cn/
只能说这里有。
kennedy32
2013-11-08 13:13:57 +08:00
我记得这个自带论坛的
EthanZhu
2013-11-08 13:18:13 +08:00
@nodejx 这个要邀请才能注册?
nodejx
2013-11-08 14:10:14 +08:00
@EthanZhu taobao
ChiangDi
2013-11-08 20:07:34 +08:00
@acpp 同感:-D
这个头像看起来真的很可爱呢
acpp
2013-11-08 20:25:34 +08:00
@ChiangDi 你也去那个网站找下,看看哪个是大图
ChiangDi
2013-11-08 21:44:06 +08:00
@acpp 注册不了,貌似是个很高端的组织,不让进

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/88513

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX