V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Pzdmultiverse
V2EX  ›  问与答

python easygui.msgbox 显示多了个大括号?

  •  
  •   Pzdmultiverse · 2016 年 3 月 6 日 · 1988 次点击
    这是一个创建于 3599 天前的主题,其中的信息可能已经有所发展或是发生改变。
    import easygui                                           
    f = float(easygui.enterbox("please enter a f")
    c = (f - 32)*5/9                                         
    easygui.msgbox(msg=("the temp is "+str(c))) 
    
    # 这个的输出结果是
    the temp is 666.6666666666666
    
        import easygui                                           
    f = float(easygui.enterbox("please enter a f")
    c = (f - 32)*5/9                                         
    easygui.msgbox(msg=("the temp is ",str(c))) 
    
    # 这个的输出结果是
    {the temp is} 666.6666666666666
    

    为啥多了个大括号,这个逗号到底是意味着啥,还是说我的 msg 的用法错了,求解呀?

    3 条回复    2016-03-06 22:20:00 +08:00
    aver4vex
        1
    aver4vex  
       2016 年 3 月 6 日
    ("the temp is ",str(c)) 这是一个元祖
    aver4vex
        2
    aver4vex  
       2016 年 3 月 6 日
    元祖->元组
    Pzdmultiverse
        3
    Pzdmultiverse  
    OP
       2016 年 3 月 6 日
    @aver4vex 那元组为什么后面的数字没在大括号里面?
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   4634 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:01 · PVG 18:01 · LAX 02:01 · JFK 05:01
    ♥ Do have faith in what you're doing.