Classic stories you know and love- translated into Python code!
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Goldilocks code page sample.jpgSample code page from Goldilocks and the Three BearsJPEG Image - 1.09 MB - 08/24/2021 at 18:08 |
|
|
Goldilocks illustration.jpgAccompanying illustrationJPEG Image - 677.91 kB - 08/24/2021 at 18:08 |
|
|
Create an account to leave a comment. Already have an account? Log In.
Great idea and quite nicely done, but within 5 minutes I found a mistake:
In Humpty, you say "because any 'if' condition evaluates to a boolean and does not need to be compared to True" when in fact the point is that "if" needs a boolean which is usually obtained from comparisons, but "humpty_on_wall" is already a boolean. The way you put it is that you compare the result of the 'if' with a boolean which would make the 'if' sort of "disappear" as already "used" in the operation before the comparison.
Thanks for your comment. My ordering is referring to the condition’s evaluation: humpty_on_wall stores True, so the if condition evaluates to True, and the block executes.
You group 'if' with humpty_on_wall then say it's not necessary to compare the result with "true". Whatever is AFTER the if is evaluated first, and indeed it doean't need a comparison because it's already boolean. Read it again :-)
The way to put it is that since humpty_on_wall IS already a boolean, (as opposed to the other variables which are strings therefore DO need to be compared)... of course; write it nicer; you do write nice :-)
Thank you so much! I apologize for the late response- I wasn't notified about this comment!
Thank you! Yes it's for beginners. :) I'm sorry to respond 4 years later...I wasn't sent a notification about this comment!
Become a member to follow this project and never miss any updates
When my daughter was about 10+/-2, I gave her a computer and a book on how to make her own games in python. It worked!!! Today I told her I know what book I'll give her kids when they can read/write :-D Good work!