- 帖子
- 2
- 精华
- 0
- 积分
- 8
- 阅读权限
- 10
- 注册时间
- 2018-5-2
- 最后登录
- 2018-5-4
|
- favorite_languages = {
- 'jen':['python','ruby'],
- 'sarah':['c'],
- 'edward':['ruby','go'],
- 'phil':['python','haskell'],
-
- if len(value for value in favorite_languages.values()) == 1:
- for name,languages in favorite_languages.items():
- print('\n' + name.title() + " 's favorite language is: ")
- for language in languages:
- print('\t' + language.title())
- if len(favorite_languages.values()) > 1:
- for name,languages in favorite_languages.items():
- print('\n' + name.title() + " 's favorite language are: ")
- for language in languages:
- print('\t' + language.title())
复制代码 这是我完整的代码。 |
|