首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
广告
V2EX
›
问与答
python 初学加法问题
skyreal
·
2015-09-17 14:37:21 +08:00
· 1886 次点击
这是一个创建于 3442 天前的主题,其中的信息可能已经有所发展或是发生改变。
# -*- 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
·
实用小工具
·
4892 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 23ms ·
UTC 09:49
·
PVG 17:49
·
LAX 01:49
·
JFK 04:49
Developed with
CodeLauncher
♥ Do have faith in what you're doing.