-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ch12 Dictionaries. #370
Conversation
Thank you! This is a good start. Almost all these comments are about things that are very easy to fix.
That's because that type of parameter has never appeared in exercises before! By the way, when you run |
Looks like you're having git problems. I completely sympathise, I've had similar struggles and I still don't fully understand this stuff. The easiest option might be to just create a new branch from master, copy in the files that you're actually changing (I think there's just two), and make a new PR. |
Apparently the names of the classes matter somehow - not sure how though.
We moved the text to where it should appear(after the program_indented) but it doesn't appear, even after the step is finished. plz help
No need to apologize, I appreciate the help. Why the new PR in #383? This one is identical and the remaining comments are still relevant. |
… code anyway and get an error about the exercise
It's my turn to apologise for slowness 😅 Let me know what you think of my changes. Otherwise there's a TODO that needs resolving, and I think the hints need to be fleshed out more. |
Thank you for your help! Do you want to continue with the rest of the dicts chapter? Alternatively, I saw you started translating to Russian way back. I don't know why you chose to stop, but that would still be appreciated! |
Hi Alex,
I was wondering if you had any other draft chapters written up in markup
which I could try to work on?
Sincerely,
Andrew Pluzhnikov
…On Sun, Oct 16, 2022 at 2:26 AM Alex Hall ***@***.***> wrote:
Merged #370 <#370> into
master.
—
Reply to this email directly, view it on GitHub
<#370 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AS3GQAALIVTBLRX6KIDB5JTWDPC33ANCNFSM53JO7N2A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi @AndrewPluzhnikov, I appreciate the enthusiasm to keep contributing. I've just finished another page on https://demo.hedgedoc.org/OH78A7uwTDOjeMM4v0QFLg?edit, here's a copy: Now we'll learn how to add key-value pairs to a dictionary,
Pretty simple. We can also change the value at an index, replacing it with a different one:
// This step should have What if we used that idea to create our list in the first place?
Sorry, that's not allowed. For lists, subscript assignment only works for existing valid indices.
Note that // This step should have That's exactly what we need. When the customer says they want 5 million boxes,
and an example of how a session should look:
Note that // This also needs a MessageStep which is triggered if the user's solution is correct except that the values Well done! Next exercise: earlier we defined a function
Perfect! This is like having a nice receipt full of useful information. Let's come back to the example of using dictionaries for translation. Suppose we have one dictionary
// this step should have Great job! Of course, language isn't so simple, and there are many ways that using a dictionary like this could go wrong.
Magnificent! Jokes aside, it's important to remember how exactly this can go wrong. Just like multiple items in the store But there are many situations where you can be sure that the values in a dictionary are unique and that this
Now we can construct the
For this to work, we just have to make sure that all the values in |
Alex,
Here is approximately the first half of the Dictionaries chapter from issue #363 .
Please let me know if I am making some mistakes or if you have any comments.
I also fixed a bug in exercises.py. When the input parameter is of type
Dict[str, str]
, runninggenerate.sh
resulted in the error below: