Collect and sort square numbers in ascending order from three lists: Difference between revisions

Line 120:
print("working...")
list = [(3,4,34,25,9,12,36,56,36),(2,8,81,169,34,55,76,49,7),(75,121,75,144,35,16,46,35)]
PrimesSquares = []
 
def issquare(x):
Line 126:
if x == p*p:
return 1
#return 0
 
for n in range(3):
for m in range(len(list[n])):
if issquare(list[n][m]):
PrimesSquares.append(list[n][m])
 
PrimesSquares.sort()
print(PrimesSquares)
 
print("done...")
2,468

edits