Advertisement
msoo248

Untitled

Jul 9th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. liczba =input('Podaj liczbę: ')
  2. import math
  3. if int(liczba)>0:
  4.   wynik= math.log(int(liczba),2)
  5.   if (wynik-int(wynik) == 0):
  6.     print ('liczba jest potęgą 2')
  7.   else:
  8.     print('liczba nie jest potęgą 2')
  9. else:
  10.   print('liczba nie jest potęgą 2')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement