Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
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
5 Answers
+ 3
You didn't give proper indention. As python is fully based on indention. Plz make your indention proper. Then surely your code may work perfectly
+ 3
Give 4 spaces or simply give a tab it will work fine. Try it once again!!
+ 1
Even if it printed, it would result in False for x <= 2 and True otherwise
+ 1
You need to write prime function before the if else statement then it may work fine
0
Please give the proper indention It would be so helpful