Answer to Question #321595 in Python for Chany

Question #321595

Take in a number




from the user print if it's divisible by 3 or 5 or 3 and 5

1
Expert's answer
2022-06-20T08:36:10-0400
n = int(input())
if n % 3 == 0:
    if n % 5 == 0:
        print(f'{n} divisible by 3 and 5')
    else:
        print(f'{n} divisible by 3 ')
elif n % 5 == 0:
    print(f'{n} divisible by 5')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS