Initial release
This commit is contained in:
15
Mon beau miroir... .py
Normal file
15
Mon beau miroir... .py
Normal file
@@ -0,0 +1,15 @@
|
||||
liste = (396, 294, 290, 861, 481, 194, 570, 463, 265, 935)
|
||||
|
||||
def palindrome(value):
|
||||
ope = 0
|
||||
while str(value) != str(value)[::-1]:
|
||||
value = value + int(str(value)[::-1])
|
||||
ope += 1
|
||||
|
||||
return [value, ope]
|
||||
|
||||
res = list()
|
||||
|
||||
for i in liste:
|
||||
res.append(palindrome(i))
|
||||
print(res)
|
||||
Reference in New Issue
Block a user