I tried running the following code in IDLE (3.1.2) and it just closed after running some time. Could you guys help me out with this. I also tried running the program in Geany and there was the same problem.
a=100 b=100 great=0 multiples=[] palin=[] #create nested loops to create list of multiples of all three digit numbers. while a<1000: while b<1000: multiples.append(a*b) b+=1 a+=1 for n in multiples: if str(n)==str(n)[::-1]: palin.append(n) for a in palin: if a>great: great=a print(great)
The code is supposed to find the greatest palindromic number formed by the multiplication of two 3-digit numbers.


Sign In
Create Account

Back to top









