That's the problem at the top, and that's the code I wrote at the bottom. If you print it out like this, only the prime factor comes out, so can you tell me how to express it as an exponent and a product like the output example?
python
num = int(input())
p = 2
if num == 1:
print("error")
else:
while True:
c = 0
while num % p == 0:
num = num // p
c += 1
if c:
print(f"{p}^{c}", end="")
if num == 1:
break
print(" X ", end="")
p += 1
if num%count == 0
Replace this part with while
and count the number of times.
© 2024 OneMinuteCode. All rights reserved.