forked from 521xueweihan/python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex3.py
44 lines (31 loc) · 1.03 KB
/
ex3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#coding:utf-8
#################
# 习题3:数字和数字计算
#################
print "I will count my chickens:"# 我要数数我的鸡 0.0
print u"Hens, 母鸡",25+30 / 6
print u"Roosters, 公鸡",100-25*3%4
print u"Now I will count the eggs:(现在我要数鸡蛋了:)"
print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
print "Is it true that 3 + 2 < 5 - 7?"
print 3 + 2 < 5 - 7
print "What is 3 + 2?",3 + 2
print "What is 5 - 7?",5 - 7
print "Oh, that's why it's False."
# 我写不下去了!!太白痴了
print "How about some more."
print "Is it greater?",5 > -2
print "Is it greater or equal?",5 >= -2
print "Is it less or equal?",5 <= -2
# 笔记
# 1.写注释的时候最好像这样写
# 利用快捷键ctrl+d 多复制几行
# 2.注意:
# 输出后面加计算要记得加 ‘,’
print "20 / 3 =",20 / 3
# 注意浮点数的概念,应该写成:
print u"朋友应该这样写:"
print "20.0 / 3 =",20.0 / 3
# 3.除法计算结果小?
print u"瞧一瞧,看一看啦!"
print "7 / 6 < 7.0 / 6.0",7 / 6 < 7.0 / 6.0