+ 3
Help me please for prime number for example;
input 280 output 280=2(3)5(1)7(1)
8 Respostas
+ 3
underestand
n=int(input())
m=n
f=2
c={}
while n>1:
i=1
while n%f==0:
c.update({f:i})
n=n/f
i+=1
f+=1
print (m,end="=")
for i in c:
print ('{}({})'.format(i,c[i]),end='')
+ 2
280
2**3=8 \
5**1=5 /=8*5*7=280
7**1=7/
+ 1
what are you having trouble with? Logic? If so, start by looking at how you calculate the factors, and see how to put it in a loop, for starters - then make it recursive.
if you are really stuck, this gives basic logic using loops https://code.sololearn.com/cq7rD6Z9Pjz3
+ 1
Okay I sent it. Good luck!
+ 1
Hi Zahra, we have a group in telegram about programming, if you need or have beatiful code, you can join us :
https://t.me/joinchat/AAAAAEDCX-6muhj7yLF5jw
0
can you give other output exemples?
0
can you send me an email address where I can send you the program I just did? I included commentaries so you can understand easier
0
correct!