print("this program will calculate the area")
input("[Press any key to start]")
width = int(input("enter width"))
while width < 0 or width > 1000:
print ("please chose a number between 0-1000")
width = int(input("enter width"))
height = int(input("Enter Height"))
while height < 0 or height > 1000:
print("please chose a number between 0-1000")
widht = int(input("Enter Height"))
area = width*height
print("The area is:",area
我添加了一条错误消息,用于输入低于或高于所述数字的数字,但是如果可能的话,如果用户输入字母或根本没有输入,我想向用户显示一条错误消息。