Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Deukhoofd
· 6y ago · 0 comments
The script you included doesn't actually work, as you're comparing a string with an integer. It will always return false.
Comments
[–]
netsharc
6y ago
Huh, did the kid understand that 3 != "3"? I'd be stumped how to explain that...
[–]
jcims
6y ago
Sure give them a cookie and a picture of a cookie.
[–]
shean_massey
6y ago
Epic, I like your analogy!
[–]
gregorymichael
6y ago
So good!
[–]
ThisIsTheWay
6y ago
Brilliant
[–]
ldeangelis
6y ago
I was going to comment the same thing. It can be fixed by addding a conversion in the if like this:
if int(guess) == lulu + boonie:
instead of
if guess == lulu + boonie:
[–]
gregorymichael
6y ago
Thanks for the catch! Should embed a version a REPL that we're not still working on.
[–]
stadt
6y ago
That's the real teachable moment ;P line 9: guess = int(input(question))