# Lesson two

Test 2：

<table class="highlighttable " style="border-collapse: collapse; margin: 0px -0.5em 0px 0.5em; color: rgb(0, 0, 0); font-family: ff-meta-web-pro-1, ff-meta-web-pro-2, Arial, 'Helvetica Neue', sans-serif; font-size: 16px; line-height: 24px;"><tbody><tr><td class="linenos" style="padding: 0px 0.5em;"><div class="linenodiv"><pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; margin: 1em 0em; font-size: 0.95em; letter-spacing: 0.015em; line-height: 18.24px; padding: 5px 0px; border: 0px; border-radius: 6px; color: rgb(170, 170, 170); background-color: transparent;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

print "I will now count my chickens:"

print "Hens", 25 + 30 / 6
print "Roosters", 100 - 25 * 3 % 4

print "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 "Is it greater?", 5 > -2
print "Is it greater or equal?", 5 >= -2
print "Is it less or equal?", 5 <= -2

1.+ puls 加号

2.- miuns 减号

3./ slash 除号

4.* asterisk 乘号

5.% percent 百分号（取余运算符）

6.< less-than 小于号

7.> Greater-than 大于号

8.<=less-than-equal 小于等于号

9.>=greater-than-equal 大于等于号

python不同于C语言，表达式能直接运算不需要赋值给一个变量（就我目前的理解来看）

Running result：

I will now count my chickens:
Hens 30
Roosters 97
Now I will count the eggs:
7
Is it true that 3 + 2 < 5 - 7?
False
What is 3 + 2? 5
What is 5 - 7? -2
Oh, that's why it's False.
Is it greater? True
Is it greater or equal? True
Is it less or equal? False

Other topics：

print	10.2+2.4

• 本文已收录于以下专栏：

举报原因： 您举报文章：Lesson two 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)