您好,我试图让我的输入只允许整数,一旦超过 10,它就会显示错误,任何帮助将不胜感激。
square_ct = input("Enter an integer from 1-5 the number of squares to draw: ")
triangle_ct = input("Enter an integer from 1-5 the number of triangles to draw: ")
while square_count(input) > 10:
print ("Error!")
square_count=input() #the statement reappears
while triangle_count(input) > 10:
print ("Error!")
triangle_count=input() #the statement reappears