0
Guys, how can I make the answer print out as a list.
''' Code to find numbers divisible by 7 but not a multiple of 5 between 2000 and 3200 ''' for i in range(2000,3201): if i%7==0 and i%5!=0: print(i,end=',')
3 odpowiedzi
+ 2
create a empty list, append every i that fulfills your conditions and last step print the list.
code:
list = []
for i in range (2000,3201):
if i%7 == 0 and i%5 != 0:
list.append (i)
print(list)
+ 1
just have i in print e.g print(i)
+ 1
aah! Got it, thanks a lot.