def prime(num): if num > 1: for i in range(2, num//2): if (num % i) == 0: return False return True #_____main_____ n=int(input("Please enter any number: ")) if prime(n): print(n,"is Prime") else: print(n,"is not Prime")Output 1:Please enter any number: 55 is PrimeOutput 2:Please enter any number: 5757 is not Prime

इन्हें भी देखें।

- while loop
- for loop
- nested loops
- loop control statements (Break, Continue, Pass)
- if statement
- if-else statement
- if-elif statement
- nested if statement
- range() function
- keywords
- Identifiers (names)
- Literals
- Operators
- punctuatorts

Python Programs के लिये यहाँ click करें।