python trying to make a counter variable to make 6 rows and 6 columns
Write a program that uses a for loop and the range function to process all integers from 999 down to zero. Code in the loop should print multiples of 40 on one line separated by spaces, but with only six on one line. See Required Output. Use a counter to determine when six multiples have been printed. Required Output 960 920 880 840 800 760 720 680 640 600 560 520 480 440 400 360 320 280 240 200 160 120 80 40 This is what i have so far counter = 0 for num in range (1000, 0, -40): if counter == counter*6: counter+=1 print("{:6d}".format(num)) else: counter=0 Output: 1000 960 920 880 840 800 760 720 680 640 600 560 520 480 440 400 360 320 280 240 200 160 120 80 40