Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 19 Online
OpenStudy (anonymous):

Does anyone understand quiz 1 problem 6?

OpenStudy (e.mccormick):

I looked at 6.189 from both 2008 and 2011. I did not see anything that said it was a quiz.

OpenStudy (anonymous):

it is 6.00SC

OpenStudy (e.mccormick):

Ah, you posted in the 6.189 area.

OpenStudy (e.mccormick):

This one? 6) Consider the following code: ``` def f(s, d): for k in d.keys(): d[k] = 0 for c in s: if c in d: d[c] += 1 else: d[c] = 0 return d def addUp(d): result = 0 for k in d: result += d[k] return result d1 = {} d2 = d1 d1 = f('abbc', d1) print addUp(d1) d2 = f('bbcaa', d2) print addUp(d2) print f('', {}) print result ``` 6.1) What does it print? (9 points)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!