擅长:python、mysql、java
<p>添加<code>if</code>语句:</p>
<pre><code>favorite_languages = {
'jen': ['python', 'ruby'], # forgot comma here
'sarah': ['c'],
'edward': ['ruby', 'C++'],
'phil': ['python'],
}
for name, languages in favorite_languages.items(): # lost indentation here
if len(languages) > 1:
print('{}\'s favorite languages are {}.'.format(name.title(), ", ".join(languages)))
else:
print('{}\'s favorite language is {}.'.format(
name.title(),
languages[0].title(),
))
</code></pre>