In: Computer Science
PUT IN PYTHON LANGUAGE CODE
# Write one while-loop that starts at 500 and prints every 6th
number down to 300
# (i.e., prints 500, 494, 488, . . . etc., but does not print any
number lower than 300).
# Write one while-loop that starts at 80 and prints every 12h
number thereafter,
# but does not print any number greater than 210
# Write one while-loop that prints all the numbers from 30
through 70,
# except for the numbers 41 and 57.
# Write one while-loop that prints the sum of all the even
numbers
# (50, 52, 54, . . . etc.,) from 50 through 2000.
# Write one while-loop that prints the count of all the
numbers
# from 20 through 2500 that are divisible by 9
# (in other words prints out how many numbers are divisible by
9).
# Write one while-loop that starts at 500 and prints every 6th number down to 300 # (i.e., prints 500, 494, 488, . . . etc., but does not print any number lower than 300). i = 500 while i > 300: print(i, end = ' ') i -= 6 print() # Write one while-loop that starts at 80 and prints every 12h number thereafter, # but does not print any number greater than 210 i = 80 while i < 210: print(i, end = ' ') i += 12 print() # Write one while-loop that prints all the numbers from 30 through 70, # except for the numbers 41 and 57. i = 30 while i <= 70: if i != 41 and i != 57: print(i, end = ' ') i += 1 print() # Write one while-loop that prints the sum of all the even numbers # (50, 52, 54, . . . etc.,) from 50 through 2000. i = 50 sum_even = 0 while i <= 2000: sum_even += i i += 2 print(sum_even) # Write one while-loop that prints the count of all the numbers # from 20 through 2500 that are divisible by 9 # (in other words prints out how many numbers are divisible by 9). i = 20 count = 0 while i < 2500: if i % 9 == 0: count += 1 i += 1 print(count)
FOR HELP PLEASE COMMENT.
THANK YOU