Answer to Question #219200 in Python for Ravichandrasekhar

Question #219200

Uncommon Number

Given a number

N, find whether the number is common or uncommon. A number is considered uncommon if it is not divisible by any of the single-digit primes.Input

The first line of input is an integer

N.Output

The output should be a single line containing

True if it satisfies the given conditions, False in all other cases.Explanation

In the given example,

N = 5633 the number is not divisible by 2, 3, 5, 7. So, the number is an uncommon number.Therefore, the output should be

True.


1
Expert's answer
2021-07-20T17:01:49-0400
N=int(input("Enter a number: "))


if (N%2==0 or N%3==0 or N%5==0 or N%7==0):
    print("False")
else:
    print("True")

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