Question: Can someone help me with my code. I am having a massive logic error. choice = 1 cnt = 0 tot = 0 i =

Can someone help me with my code. I am having a massive logic error.

choice = 1 cnt = 0 tot = 0 i = 0 while choice != 0: print(" 1. Count from 0 to 75 by 5's ") print("2. Count from 3 to 129 by 7's ") print("3. Add the numbers from 210 to 235 ") print("4. Print the phrase 'Don't be evil.' one letter per line ") print("5. Print the intergers from 5 to 15 (include 5 and 15) ") print("0. Quit ") choice = int(input("Enter Choice :")) if choice == 0: break elif choice == 1: while i <= 78: if i % 5 == 0: cnt = cnt + 1 i = i + 1 print("Count from 0 to 75 by 5's is {0:d}". format(cnt)) cnt = 0 elif choice == 2: i = 3 while i <= 129: if i & 7 == 0: cnt = cnt + 1 i = i + 1 print("Count from 3 to 129 by 7's is {0:d}". format(cnt)) elif choice == 3: i = 210 while i <= 235: tot = tot + i i = i + 1 print("sum of number from 210 to 235 is {0:d}". format(tot)) elif choice == 4: str = "Don't be evil" for i in range(len(str)): print(str[i]) elif choice == 5: i = 0 for i in range (5,16): print(i)

please help with repairs.

#2 will not work at all and the code is working out of order.

the code is in python.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!