python学习:条件语句if、else

条件语句:

  1.if...else...;

  2.if...elif...esle

举例:

  1.if...else...

  “age_of_princal = 56

  guess_age = int(input(">>>>:"))
        if guess_age == age_of_princal:
        print("Yes,you got it")
        else:
  print("No,it's wrong.")”

  2.if...elif...esle...

  "score = int(input("score:"))

  if score > 90:
  print("A")
  elif score > 80:
  print("B")
  elif score > 70:
  print("C")
  elif score > 50:
  print("D")
  else:
  print("加油")"

上一篇:产业白热化竞争来临,看人工智能如何带动经济数智化发展


下一篇:提高IT运营效率的6种方法