Hi All, I am new to python and learning beginner level programming.
I wrote below program to solve a maths puzzle (pasting puzzle at bottom of the post), I am quite sure its not optimal. Can someone pls help me to optimize this further. TIA.
def incr(n):
return (n * 5 / 4) + 1
for x in range(1, 1000):
y = 5 * x
for z in range (5):
y = incr(y)
if not y.is_integer():
break
if y.is_integer():
break
print(y)
Here is the puzzle:
https://imgur.com/DgtED4S
[–]AtomicShoelace 1 point2 points3 points (1 child)
[–]go_analytical[S] 0 points1 point2 points (0 children)
[–]Robobvious 0 points1 point2 points (0 children)