习题29
- 在atom中的代码
people = 20
cats = 30
dogs=15
if people < cats:
print("too much cats")
if people>cats:
print("not many cats")
if people < dogs:
print("drooped on")
if people > dogs:
print("dry")
dogs += 5
if people >= dogs:
print("greater")
if people <= dogs:
print("less")
if people == dogs:
print("people are dogs")
-
知识点:
+=“递增”及-=“递减”运算符
-
出现的问题:
-
if语句后没带冒号
-
if后习惯性打括号
-
缺少了四个空格的缩进