立即学习:https://edu.csdn.net/course/play/24459/296925?utm_source=blogtoedu
name = input("请输入您的名字:") age = int(input("请输入您的年龄:")) school = input("请输入您的学校:") classes = input("请输入您的班级:") specialty = input("请输入您的专业:") figure = float(input("请输入您的数学成绩:")) if classes == "初二" or classes == "初一": print("您输入的班级不匹配,请重新输入!") # 编译输出格式时候后边必须跟=号 form = """ 个人信息 name :%s age :%a school :%s classes :%s specialty :%s figure :%a """%(name,age,school,classes,specialty,figure) print(type(age)) print(type(figure)) print(form)