python03-if

Posted minkillmax

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python03-if相关的知识,希望对你有一定的参考价值。

用if来实现猜年龄

 

age_of_master=66

guess_age=input(">>:")

if  age_of_master==int(guess_age):

  print("yes,you are right")  #print钱tab缩进

else:

  print("no,you must kidding me ")

 

多分支if语句:

 

score=input("you score:")

if score>90:

  print("you got an A")

elif score>80:

  print("you got an B")

elif score>60:

  print("you got an C")

else score<60:

  print("you should try harder!")

以上是关于python03-if的主要内容,如果未能解决你的问题,请参考以下文章

Python代写,Python作业代写,代写Python,代做Python

Python开发

Python,python,python

Python 介绍

Python学习之认识python

python初识