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/operator.py
Views: 729
1
"""
2
运算符的使用
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-02-27
7
"""
8
9
a = 5
10
b = 10
11
c = 3
12
d = 4
13
e = 5
14
a += b
15
a -= c
16
a *= d
17
a /= e
18
print("a = ", a)
19
20
flag1 = 3 > 2
21
flag2 = 2 < 1
22
flag3 = flag1 and flag2
23
flag4 = flag1 or flag2
24
flag5 = not flag1
25
print("flag1 = ", flag1)
26
print("flag2 = ", flag2)
27
print("flag3 = ", flag3)
28
print("flag4 = ", flag4)
29
print("flag5 = ", flag5)
30
print(flag1 is True)
31
print(flag2 is not False)
32
33