DEV Community

AbreuY
AbreuY

Posted on • Edited on

2 3

[Python] Determine if the first number is a multiple of the second

Statement:
Given two integers, determine if the first number is a multiple of the second.


Solution:

number1 = int(input("Write a number"))
number2 = int(input("Write other number"))

if number1 % number2 == 0:
    print(f'Is multiple of {number1}')
else:    
    print(f'Is not a multiple of {number2}')
Enter fullscreen mode Exit fullscreen mode

View working code

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay