Python学习笔记(路飞学城听课整理)
格式化打印
name=input("name:")
age=input("age:")
job=input("job:")
hobbie=input("hobbie:")
msg=f'''
------------ info of Alex Li -----------
Name : {name}
Age : {age}
job : {job}
Hobbie: {hobbie}
------------- end -----------------
'''
print(msg)
多分支
score = int(input("Score:"))
if score > 89:
print("A")
elif score > 79:
print("B")
elif score > 59:
print("C")
elif score > 39:
print("D")
else:
print("E")