I need to print a list of the three-digit numbers that are divisible by 17, and print how many there are in total. This is what I have so far.
I'm sure some of is right, but I get an error in line 7
TypeError: 'int' object is not iterable
print ("How many three-digit numbers are divisible by 17?")
input("Press Enter to find out...")
list_of_ints = []
for number in range(100,1000):
if number % 17 == 0:
list_of_ints += number #line 7 error
print(list_of_ints)
print(len(list_of_ints))
Any help or suggestions please?
I'm using Python 3

New Topic/Question
Reply



MultiQuote






|