-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy22.py
More file actions
56 lines (48 loc) · 852 Bytes
/
py22.py
File metadata and controls
56 lines (48 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'''a=int(input("no"))
for i in (1,1+a):
b=1
for j in range(1,i+1):
print(b,end=" ")
b+=1
print("\n")
'''
#1st way
a1=int(input("num:-"))
c=False
if a1>1:
for i in range(2,a1):
if a1%i==0:
print("np")
c=True
break
if c==False:
print("p")
else:
print("np")
#2nd way
a1=int(input("num:-"))
if a1>1:
for i in range(2,a1):
if a1%i==0:
print("np")
break
else:
print("p")
else:
print("np")
#3rd way
while True:
a1=int(input("num:-"))
c=0
if a1>1:
for i in range(2,a1):
if a1%i==0:
c+=1
if c>1:
print("np")
else:
print("p")
'''
from primePy import primes
if primes.check(a1)==True:
print("p")'''