CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day02/variable3.py
Views: 729
1
"""
2
格式化输出
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-02-27
7
"""
8
9
a = int(input('a = '))
10
b = int(input('b = '))
11
print('%d + %d = %d' % (a, b, a + b))
12
print('%d - %d = %d' % (a, b, a - b))
13
print('%d * %d = %d' % (a, b, a * b))
14
print('%d / %d = %f' % (a, b, a / b))
15
print('%d // %d = %d' % (a, b, a // b))
16
print('%d %% %d = %d' % (a, b, a % b))
17
print('%d ** %d = %d' % (a, b, a ** b))
18
19