What is the output of this code snippet?
x = y
x = x-1
y = y-1
if x==y: return "E"
x = 2 * x
if x==y: return"F"
x_old = x
x = y * y
y = 2 * x_old
Now it is getting interesting!
When I made this puzzle, I thought that it might be too simple. But look at the numbers: only 36% of our users solved it. An interesting observation is that the puzzle has still a low Elo rating. This indicates that finxters with higher Elo can solve it with very low error rates and push it downwards the Elo latter. But finxters with lower Elo ratings struggle with the puzzle.
First of all, never let the sheer mass of code intimidate you. You simply start below with the function call
y=7. Then you do what the interpreter does. As
x>y is false, you can skip the whole upper part of the function. Similarly, you can skip the if branch for
x-2>y-4, so the function returns ‘H’.
Are you a master coder?
Test your skills now!