py4e icon indicating copy to clipboard operation
py4e copied to clipboard

Small typo issue in quiz of chapter 10

Open dimitribarbot opened this issue 3 years ago • 1 comments

Dear Chuck,

I guess there is a small typo issue in question 4 of the quiz of chapter 10 where some backslashes are displayed whereas it should not, right ?

What we have:

x = \{ 'chuck' : 1 , 'fred' : 42, 'jan': 100\}
y = x.items()

What we should have:

x = { 'chuck' : 1 , 'fred' : 42, 'jan': 100 }
y = x.items()

The same issue appears in question 9.

What we have:

c = \{'a':10, 'b':1, 'c':22\}
for k, v in c.items() :
    ...

What we should have:

c = {'a':10, 'b':1, 'c':22}
for k, v in c.items() :
    ...

I suppose every student should understand these are typo issues but just to let you know.

dimitribarbot avatar Nov 27 '22 18:11 dimitribarbot

Maybe it's already fixed.

If the question numbering changes, please copy the question text as well, it helps. Thanks. Section 11 Tuples, https://www.py4e.com/lessons/tuples

I don't see the \ in Chrome Version 111.0.5563.65 (Official Build) (64-bit), Win 11 22H2 x64

Q4
In the following Python code, what will end up in the variable y?

x = { 'chuck' : 1 , 'fred' : 42, 'jan': 100}
y = x.items()
Q9
In the following Python loop, why are there two iteration variables (k and v)?

c = {'a':10, 'b':1, 'c':22}
for k, v in c.items() :
...

It's also okay on Coursera, course 2 week 6, https://www.coursera.org/learn/python-data/exam/6ab9s/chapter-10-quiz/attempt

srcatto avatar Mar 19 '23 21:03 srcatto