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

python 初学加法问题

  •  
  •   skyreal · 2015-09-17 14:37:21 +08:00 · 1688 次点击
    这是一个创建于 3141 天前的主题,其中的信息可能已经有所发展或是发生改变。
    # -*- coding:utf-8 -*-
    from sys import argv
    script, aa, bb = argv
    aa = raw_input ('你有多少只鸡:')
    bb = raw_input ('你有多少只鸭:')
    print "你一共有鸡鸭:", aa+bb

    输入鸡1鸭2,输出12

    不应该是3嘛?
    2 条回复    2015-09-17 16:08:18 +08:00
    tonghuashuai
        1
    tonghuashuai  
       2015-09-17 14:49:12 +08:00   ❤️ 1
    print "你一共有鸡鸭:", int (aa )+int (bb )
    skyreal
        2
    skyreal  
    OP
       2015-09-17 16:08:18 +08:00
    谢谢!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5401 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:43 · PVG 16:43 · LAX 01:43 · JFK 04:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.