+ 1
What would you change in this code?
Feel free to give me some advice and tell me what you would change here to make it perfect. CODE: https://code.sololearn.com/cSQUT7x6aks7/#py
3 RĂ©ponses
+ 11
Of course :) We are all here to learn and help each other.
+ 9
Interesting approach. To be honest, I'd check out the numbers before adding them, though. Saves time and memory.
So:
for i in range(dice):
x = random.randint(100000, 1000000)
if str(x) == str(x)[::-1]:
total.append(x)
print(total)
+ 2
@Kuba SiekierzyĆski Wow this would make my code much smaller ^^ is it okey if i use it ?