#Jacob Rutter, Loop Practice def main(): total = 0 keep_going = 'y' while keep_going == 'y': for int in range(num1, num2+1,1): if int % 3 != 0 or int % 4 != 0 or int % 5 != 0: total = total + 0 start = (input('Enter the first number:')) num1 = int(start) end = (input('Enter the second number:')) num2 = int(end) print ('The starting number is,'(num1)) print ('The ending number is,'(num2)) print ('The total is', total) keep_going = input('Do you want to calculate another?' + \ '(Enter y for yes)') main()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question