Python语言入门 已知数a为20,数b为10,求a与b的余数、商、和、差。
答案:3 悬赏:20
解决时间 2021-04-09 22:56
- 提问者网友:很好的背叛
- 2021-04-09 04:15
Python语言入门 已知数a为20,数b为10,求a与b的余数、商、和、差。
最佳答案
- 二级知识专家网友:最后战士
- 2021-04-09 04:47
Python 2.7.9 (default, Dec 11 2014, 04:42:00)
Type "copyright", "credits" or "license" for more information.
IPython 2.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: a=20
In [2]: b=10
In [3]: a%10 #余数
Out[3]: 0
In [4]: a/b #商
Out[4]: 2
In [5]: a+b #和
Out[5]: 30
In [6]: a-b #差
Out[6]: 10
In [7]:如果解决了您的问题请采纳!
如果未解决请继续追问
Type "copyright", "credits" or "license" for more information.
IPython 2.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: a=20
In [2]: b=10
In [3]: a%10 #余数
Out[3]: 0
In [4]: a/b #商
Out[4]: 2
In [5]: a+b #和
Out[5]: 30
In [6]: a-b #差
Out[6]: 10
In [7]:如果解决了您的问题请采纳!
如果未解决请继续追问
全部回答
- 1楼网友:陪伴是最长情的告白
- 2021-04-09 06:23
a = 20
b = 10
print(str(a) + '+' + str(b) + '=' + str(a+b))
print(str(a) + '-' + str(b) + '=' + str(a-b))
print(str(a) + '/' + str(b) + '=' + str(int(a/b)) + '...' + str(a%b))
- 2楼网友:白日梦制造商
- 2021-04-09 05:28
我是来看评论的
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯