0

It is not working properly

num = int(input()) def prime(num): flag = False if num > 1: for i in range(2,num): if num % i !=0: flag = True break if flag is True: print(f"{num} is a prime") else: print(f"{num} is not a prime") prime(num) This is not telling me if a number is prime or not

19th Aug 2021, 10:17 AM
Tarun
2 Answers
+ 1
Even if it printed, it would result in False for x <= 2 and True otherwise
19th Aug 2021, 10:58 AM
Angelo
Angelo - avatar
0
Please give the proper indention It would be so helpful
19th Aug 2021, 10:23 AM
Tarun