Question

Write a complete program that prints numbers from 1 to 50, but if numbers that are...

Write a complete program that prints numbers from 1 to 50, but if numbers that are multiples of 5, print HiFive, else if numbers that are divisible by 2, print HiTwo, and else if numbers that are divisible by 3 or 7, print HiThreeorSeven *Please in python*

0 0
Add a comment Improve this question Transcribed image text
Answer #1
for i in range(1, 51):
    if i % 5 == 0:
        print("HiFive")
    elif i % 2 == 0:
        print("HiTwo")
    elif i % 3 == 0 or i % 7 == 0:
        print("HiThreeorSeven")
    else:
        print(i)

Add a comment
Know the answer?
Add Answer to:
Write a complete program that prints numbers from 1 to 50, but if numbers that are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT