网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  Python 中 参数* 和 **

Python 中 参数* 和 **

分类: IT文章 • 2022-06-13 09:33:35

举个例子就知道了

class test():

    def __init__(self, *a, **b):
        print(a)
        print(b)
        print(b.get('test'))


tester = test(1, 2, 3, test='abc')

输出如下

(1, 2, 3)
{'test': 'abc'}
abc

Process finished with exit code 0

相关推荐

  • JS中的showModelDialog详解和实例
  • python中的继承、多继承、超继承
  • 审批中关于e.Url的说明和使用
  • C++中的栈和队列
  • Python中关于字符串的问题
  • python函数名和左括号之间不能有空格
  • Python虚拟环境的安装和配置-virtualenv Python虚拟环境的安装和配置-virtualenv
  • C++中,关于#include<***.h>和#include"***.h"的区别
  • postman的正则提取和内置动态参数,cookie提取
  • python模块和包
  • Linux Crontab格式说明
  • heartbeat 心跳技术
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号