Create Account

SMJHL All-Star Game Roster and Logo Announcement
#63
(This post was last modified: 04-03-2021, 09:58 AM by luke.)

Code:
def main():
    number = int(input("Please enter a valid number: "))

    print("The factors of your chosen number, {0}, are:".format(number))
    factor(number)
    start_again()

def factor(num):
    for value in range(1, num + 1):
        if (num % value == 0):
            print("{0}".format(value))
    return


def start_again():
    user_input = input("Would you like to enter another number? Yes or No.")
    if user_input.lower(num) == 'yes' or user_input.lower() == 'y':
        return main(num)
    elif user_input.lower() == 'no' or user_input.lower() == 'n':
        exit()

main()
Reply


Messages In This Thread
RE: SMJHL All-Star Game Roster and Logo Announcement - by lisa - 04-03-2021, 09:42 AM



Users browsing this thread:
1 Guest(s)




Navigation

 

Extra Menu

 

About us

The Simulation Hockey League is a free online forums based sim league where you create your own fantasy hockey player. Join today and create your player, become a GM, get drafted, sign contracts, make trades and compete against hundreds of players from around the world.