# vrati mocninu e prvocisla p ktora deli number # teda pre power(100, 5) --> 2 lebo 5^2 | 100 def power(number, p): counter = 0 while number != 0: number //= p counter += 1 return counter #vyise faktorizaciu cisla number #factor(number) --> 2^2*5^2 def factor(number): p = 2 while number != 0: e = power(number, p) if e > 0: print(p,"^",e,' ', sep='',end='') number //= p**e p += 1 factor(100)