table of Contents
Determine whether the input type is a number: isnumeric()
input () basic use
score = input("请输入你的分数:")
print("你的分数是:", score)
print("-------------------")
# 分数判断
if int(score) >= 60:
print("恭喜你,及格了!")
else:
print("分数没及格!")
Determine whether the input type is a number: isnumeric()
score = input("请输入你的分数:")
print("你的分数是:", score)
print("-------------------")
# 数字判断
if score.isnumeric():
if int(score) >= 60:
print("恭喜你,及格了!")
else:
print("分数没及格!")
else:
print("请输入数字!")