设为首页收藏本站

Crossin的编程教室

 找回密码
 立即加入
查看: 3574|回复: 0
打印 上一主题 下一主题

关于Py编程的一点小问题

[复制链接]

1

主题

0

好友

5

积分

新手上路

Rank: 1

跳转到指定楼层
楼主
发表于 2017-9-15 06:02:58 |只看该作者 |倒序浏览
代码如下:
def build_profile(first, last, **user_info):
    profile = {}
    profile['first_name'] = first
    profile['last_name'] = last
    for key, value in user_info.items():
        profile[key] = value
    return profile

user_profile = build_profile('ksco', 'hznu_',
                             location = 'Hangzhou',
                             song = 'abcd')

print(user_profile)


关于return profiles 那里不是很明白 我删掉那行代码就显示None了,还是对return 不是很明白
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

QQ|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号  

GMT+8, 2024-4-27 11:01 , Processed in 0.014981 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部