[Tutor] Code

hari ganivada hariganivada81 at gmail.com
Thu Jul 13 09:13:18 EDT 2023


Sir

  I am hari Ganivada.
   def is _power_off_two(number)
   number=2
  while number ℅ 2==0:
  number = number/2
 If number == 1:
    return true
  return False
Call to the function
print(is_power_of_two(0)) # should be False
print(is_power_of_two(1))# should be true
print(is_power_of_two(8))#should be true
print(is_power_of_two(9))#should be false.

Please help me sir



---------- Forwarded message ---------
From: hari ganivada <hariganivada81 at gmail.com>
Date: Thu, 13 Jul, 2023, 18:41
Subject:
To: <tutor at python.org>


Sir

  I am hari Ganivada.
   def is _power_off_two(number)
   number=2
  while number ℅ 2==0:
  number = number/2
 If number == 1:
    return true
  return False
Call to the function
print(is_power_of_two(0)) # should be False
print(is_power_of_two(1))# should be true
print(is_power_of_two(8))#should be true
print(is_power_of_two(9))#should be false.

Please help me sir


More information about the Tutor mailing list