#write a program to print perfect square numbers def perfect_square(n): left,right=2,n//2 while left<=right: mid=(right+left)//2 square=mid*mid if square==n: return True elif square < n: left=mid+1 else: right=mid-1 return False n=16 print(perfect_square(n)) perfect_square_number=[] for i in range(1000): if perfect_square(i): perfect_square_number.append(i) print(perfect_square_number)
@siddharthabandi7307Ай бұрын
Thanks for the video sir
@siddharthabandi7307Ай бұрын
Sir, one small suggestion can please do the videos in telugu
@Code_with_bharath15Ай бұрын
@@siddharthabandi7307 okay bro next videos Telugu lo chestha
@siddharthabandi7307Ай бұрын
Hello sir
@Code_with_bharath15Ай бұрын
Hii bro
@Code_with_bharath15Ай бұрын
it is the code I mentioned in the video: def is_prime(n): if n<=1: return False if n==2: return True for i in range(2,int(n**0.5)+1): if n%i==0: return False return True def is_twisted(n): if not is_prime(n): return False reversed_n=int(str(n)[::-1]) return is_prime(reversed_n) and reversed_n != n n=41 print(is_prime(n)) print(is_twisted(n))