Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- liczba =input('Podaj liczbę: ')
- import math
- if int(liczba)>0:
- wynik= math.log(int(liczba),2)
- if (wynik-int(wynik) == 0):
- print ('liczba jest potęgą 2')
- else:
- print('liczba nie jest potęgą 2')
- else:
- print('liczba nie jest potęgą 2')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement