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

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

  •  
  •   Pzdmultiverse · 2016-03-06 14:31:10 +08:00 · 1769 次点击
    这是一个创建于 2987 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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-03-06 21:28:12 +08:00
    ("the temp is ",str(c)) 这是一个元祖
    aver4vex
        2
    aver4vex  
       2016-03-06 21:28:31 +08:00
    元祖->元组
    Pzdmultiverse
        3
    Pzdmultiverse  
    OP
       2016-03-06 22:20:00 +08:00
    @aver4vex 那元组为什么后面的数字没在大括号里面?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   979 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 156ms · UTC 21:03 · PVG 05:03 · LAX 14:03 · JFK 17:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.