Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Facebook Engineering Puzzle "Hoppity Hop" - Python Code Bank


Facebook Engineering Puzzle "Hoppity Hop"
This is the first Facebook Engineering Puzzle! http://www.facebook.com/careers/puzzles.php?puzzle_id=7
                file = open('input.txt')
num = file.readline()
for i in range(1, int(num), 1):
    if (i % 3 == 0 and i % 5 == 0):
        print("Hop\n")
    elif(i % 3 == 0):
        print("Hoppity\n")
    elif (i % 5 == 0):
        print("Hophop\n")

            
Comments
Sorry but there are no comments to display