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)
In this python program it has three test cases, in this three test cases two test cases are getting expected output and third test case are not getting expected output. Please give me expexted output for three test cases. Thank you !
Question url :-
https://drive.google.com/file/d/1XrSRAXys8kKSTYMSm58aED455XD_i4tm/view?usp=sharing
Test case - 1
Input
12
Output
True
Test case - 2
Input
3
Output
False
Test case - 3
Input
1
Output
False
num = int(input())
f = False
if num > 1:
for i in range(2, num):
if (num % i) == 0:
f = True
break
if f:
print("True")
else:
print("False")
Comments
Leave a comment