News for hackers. Stuff that matters.
Re:Teaching our five year old to code by cheating by Deukhoofd on Wednesday October 07, 2020 @05:35AM (#24706589)
The script you included doesn't actually work, as you're comparing a string with an integer. It will always return false.
Re:Teaching our five year old to code by cheating by netsharc on Wednesday October 07, 2020 @05:46AM (#24706643)
Huh, did the kid understand that 3 != "3"? I'd be stumped how to explain that...
Re:Teaching our five year old to code by cheating by jcims on Wednesday October 07, 2020 @05:51AM (#24706681)
Sure give them a cookie and a picture of a cookie.
Re:Teaching our five year old to code by cheating by shean_massey on Wednesday October 07, 2020 @07:02AM (#24707037)
Epic, I like your analogy!
Re:Teaching our five year old to code by cheating by gregorymichael on Wednesday October 07, 2020 @03:14PM (#24711596)
So good!
Re:Teaching our five year old to code by cheating by ThisIsTheWay on Wednesday October 07, 2020 @02:19PM (#24711065)
Brilliant
Re:Teaching our five year old to code by cheating by ldeangelis on Wednesday October 07, 2020 @08:50AM (#24707639)
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:
Re:Teaching our five year old to code by cheating by gregorymichael on Wednesday October 07, 2020 @12:34PM (#24709916)
Thanks for the catch! Should embed a version a REPL that we're not still working on.
Re:Teaching our five year old to code by cheating by stadt on Wednesday October 07, 2020 @06:04AM (#24706742)
That's the real teachable moment ;P line 9: guess = int(input(question))