logo CodeStepByStep logo

print_odds

Language/Type: Python parameters print

What output is produced by the following program?

def print_odds(n):
    for i in range(1, n + 1):
        odd = 2 * i -  1
        print(odd, end=" ")
    print()

def main():
    print_odds(3)
    print_odds(17 // 2)
    x = 25
    print_odds(37 -  x + 1)

main()
line 1
line 2
line 3

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.