[Tutor] Module Review

Thurman Hill THURMHILL33 at outlook.com
Wed Apr 12 12:48:16 EDT 2023


I’m getting a type error when I put this into the blanks… Please help I’ve been stuck for weeks…




Fill in the blanks to print the even numbers from 2 to 12.

number = range(2,12+1,2) # Initialize the variable
while number > 0: # Complete the while loop condition
    print(number, end=" ")
    number # Increment the variable

# Should print 2 4 6 8 10 12

Error:
Error on line 2:
    while number > 0: # Complete the while loop condition
TypeError: '>' not supported between instances of 'range' and 'int'

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows



More information about the Tutor mailing list