发布时间:2019-09-08 09:11:38编辑:auto阅读(1893)
##
##def functiontest():
## x=int(raw_input('please input number:'));
## if(x>8):
## print "larger than 8";
## else:
## print "lower than 8";
##functiontest();
##
##def functionSex():
## sex=str(raw_input('please input number:'));
## if(sex=="male"):
## print "male";
## else:
## print "lady";
##
##functionSex();
###if else multi 嵌套对齐
##def grade():
## x=int(raw_input("print you grade:"));
## print x;
## if(x>=90):
## print "A";
## else:
## if(x>=80):
## print "B";
## else:
## if(x>=70):
## print "C";
## else:
## if(x>=60):
## print "D";
## else:
## print "E";
##
##grade()
#对齐 if 条件表达式非0就真
def multigrade():
x=int(raw_input("print you grade:"));
print x;
if(x>=90):
print "A";
elif(x>=80):
print "B";
elif(x>=70):
print "C";
elif(x>=60):
print "D";
else:
print "E";
multigrade();
#条件的判断 逻辑表达式:双目运算/单目运算++
#-and or not
sex=raw_input("input sex:");
if (sex=='M' or sex=='m' or sex=='man'):
print 'man';
if sex!='woman':
print 'haha';
上一篇: [Python学习记录]——Hello
下一篇: grpc python 和Java实现
48923
48033
38790
35919
30340
27119
26124
20957
20779
19137
650°
730°
700°
693°
669°
635°
735°
816°
925°
1136°