V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hsumin
V2EX  ›  程序员

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

  •  
  •   hsumin · 2013-11-08 11:25:55 +08:00 · 4331 次点击
    这是一个创建于 3837 天前的主题,其中的信息可能已经有所发展或是发生改变。
    求助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()
    9 条回复    1970-01-01 08:00:00 +08:00
    nodejx
        1
    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
        2
    acpp  
       2013-11-08 12:03:43 +08:00
    @nodejx 头像有大图吗
    nodejx
        3
    nodejx  
       2013-11-08 12:33:19 +08:00
    @acpp http://www.p1.cn/
    只能说这里有。
    kennedy32
        4
    kennedy32  
       2013-11-08 13:13:57 +08:00 via Android
    我记得这个自带论坛的
    EthanZhu
        5
    EthanZhu  
       2013-11-08 13:18:13 +08:00
    @nodejx 这个要邀请才能注册?
    nodejx
        6
    nodejx  
       2013-11-08 14:10:14 +08:00
    @EthanZhu taobao
    ChiangDi
        7
    ChiangDi  
       2013-11-08 20:07:34 +08:00 via Android
    @acpp 同感:-D
    这个头像看起来真的很可爱呢
    acpp
        8
    acpp  
       2013-11-08 20:25:34 +08:00
    @ChiangDi 你也去那个网站找下,看看哪个是大图
    ChiangDi
        9
    ChiangDi  
       2013-11-08 21:44:06 +08:00
    @acpp 注册不了,貌似是个很高端的组织,不让进
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2175 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:27 · PVG 08:27 · LAX 17:27 · JFK 20:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.