Answer to Question #221421 in Python for Hari nadh babu

Question #221421

Composite Number


This Program name is Composite Number. Write a Python program to Composite Number


The below link contains Composite Number question, explanation and test cases


https://drive.google.com/file/d/1XrSRAXys8kKSTYMSm58aED455XD_i4tm/view?usp=sharing


We need exact output when the code was run

1
Expert's answer
2021-08-03T03:43:43-0400
num = int(input())
if num > 1:
    for i in range(2, int(num/2)+1):
        if (num % i) == 0:
            print(True)
            break
    else:
        print(False)
  
else:
    print(True)

Input 1:
12
Output 1:
True

Input 2:
3
Output 2:
False

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