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

2013 年 11 月 8 日
 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()
5160 次点击
所在节点    程序员
9 条回复
nodejx
2013 年 11 月 8 日
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 月 8 日
@nodejx 头像有大图吗
nodejx
2013 年 11 月 8 日
@acpp http://www.p1.cn/
只能说这里有。
kennedy32
2013 年 11 月 8 日
我记得这个自带论坛的
EthanZhu
2013 年 11 月 8 日
@nodejx 这个要邀请才能注册?
nodejx
2013 年 11 月 8 日
@EthanZhu taobao
ChiangDi
2013 年 11 月 8 日
@acpp 同感:-D
这个头像看起来真的很可爱呢
acpp
2013 年 11 月 8 日
@ChiangDi 你也去那个网站找下,看看哪个是大图
ChiangDi
2013 年 11 月 8 日
@acpp 注册不了,貌似是个很高端的组织,不让进

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

https://v2ex.xtra.eu.org/t/88513

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

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

© 2021 V2EX