Professional Documents
Culture Documents
def isFlip(n):
zer=0
on=0
for ch in n:
if(ch=='0'):
zer+=1
elif(ch=='1'):
on+=1
return zer,on
zero,one=isFlip(no)
print("No. It is not possible to flip a single digit to make all the digits same.")
else:
print("Yes. It is possible to flip a single digit to make all the digits same.")
def isPrime(n):
c=0
if n>1:
for t in range(2,n):
if(n%t)==0:
c=c+1
if c==0:
return True
else:
return False
for i in range(2,N+1):
first=isPrime(i)
second=isPrime(N-i)
break
else:
continue
return True
else:
return False
for i in range(2,N+1):
first=isPrime(i)
second=isPrime(N-i)
if first==True and second==True:
print("Yes, it is possible to represent entered number as a sum of two semi-primes.")
break
else:
continue