首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
V2EX
›
问与答
python 初学加法问题
skyreal
·
2015-09-17 14:37:21 +08:00
· 2120 次点击
这是一个创建于 3690 天前的主题,其中的信息可能已经有所发展或是发生改变。
# -*- coding:utf-8 -*-
from sys import argv
script, aa, bb = argv
aa = raw_input ('你有多少只鸡:')
bb = raw_input ('你有多少只鸭:')
print "你一共有鸡鸭:", aa+bb
输入鸡1鸭2,输出12
不应该是3嘛?
argv
raw_input
鸡鸭
Coding
2 条回复
•
2015-09-17 16:08:18 +08:00
1
tonghuashuai
2015-09-17 14:49:12 +08:00
1
print "你一共有鸡鸭:", int (aa )+int (bb )
2
skyreal
OP
2015-09-17 16:08:18 +08:00
谢谢!
关于
·
帮助文档
·
自助推广系统
·
博客
·
API
·
FAQ
·
Solana
·
2714 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms ·
UTC 02:03
·
PVG 10:03
·
LAX 19:03
·
JFK 22:03
♥ Do have faith in what you're doing.
❯