Che cosa non funziona? :-) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 11

Che cosa non funziona? :-)

Hi everyone, could you explain to me what is wrong with this code?in addition to giving me some good advice to improve my codes? and always nice for beginners to receive useful advice from those who are better !! thank you so much!! Here is the code: numero=input("Inserire un numero: ") print(numero) print("---------------------------------") #Funzione di somma radici def somma(numero): while int(numero) >= 1 and not int(numero) is 4: for x in range(int(numero)): d=0 d=str(numero) if d or not str(d[:-1]): for x in str(d)[:-1]: e=int(d[0])** 2 + int(d[1])** 2 else: e=int(numero)**2 if e == 1: print("Il numero", e,"e un numero felice") elif e == 4: print("Il numero ", e, "non e un numero felice") else: return somma(str(e)) print(somma(numero))

5th Jul 2018, 10:18 AM
<StraMa/Design>
<StraMa/Design> - avatar
5 Respostas
+ 8
Maurizio Strazzullo perĆ² se scrivi in italiano nel codice gli altri non capiranno cosa cerchi di fare con questo codice
14th Jul 2018, 1:47 PM
alfa6
alfa6 - avatar
+ 7
alfa6 hai ragione volevo modificarlo infatti šŸ˜‚ ma poi mi sono dimenticato šŸ˜‚šŸ˜‚
15th Jul 2018, 5:14 PM
<StraMa/Design>
<StraMa/Design> - avatar
+ 7
where do u live???
21st Jul 2018, 5:36 PM
Sojib Islam šŸ‡§šŸ‡©
Sojib Islam šŸ‡§šŸ‡© - avatar
5th Jul 2018, 12:09 PM
<StraMa/Design>
<StraMa/Design> - avatar
+ 1
what are you trying to do?
5th Jul 2018, 11:02 AM
Ulisses Cruz
Ulisses Cruz - avatar