Help Needed - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Help Needed (/thread-10487.html) |
Help Needed - alwillia - May-23-2018 Need help for the following: numerator = int(input("Enter a numerator: ")) denominator = int(input("Enter denominator: ")) # Use a while loop here to repeatedly ask the user for # a denominator for as long as the denominator is 0 # (or, put another way, until the denominator is not # equal to 0). if numerator / denominator * denominator == numerator: print "Divides evenly!" else: print "Doesn't divide evenly." RE: Help Needed - buran - May-23-2018 What have you tried? We can help, but we are not going to do it for you. RE: Help Needed - alwillia - May-23-2018 while denominator != 0: denominator = int(input("Enter denominator: "))I have only been doing this two weeks. It seems to be getting hard fast. RE: Help Needed - buran - May-23-2018 OK, that's it more or less... However read your assignment one more time. What denominator value should be accepted? Is this denominator != 0 correct condition?
RE: Help Needed - alwillia - May-23-2018 changed it to == and it worked. Thanks |