*相当于解压的作用,当list中只有一个元素时,利用*作用相当于直接去[],去[]后的数据类型是字符串。

_list  = [1,2,3]
_tuple = (1,2,3)
_dict = {1:'a', 2:'b', 3:'c'}
print('_list is', *_list)
print('_tuple is', *_tuple)
print('_dict is', *_dict)
# _list is 1 2 3
# _tuple is 1 2 3
# _dict is 1 2 3

参考:https://blog.csdn.net/weixin_40877427/article/details/82931899

list、tuple、dict加*星号的更多相关文章

  1. Python中内置数据类型list,tuple,dict,set的区别和用法

    Python中内置数据类型list,tuple,dict,set的区别和用法 Python语言简洁明了,可以用较少的代码实现同样的功能.这其中Python的四个内置数据类型功不可没,他们即是list, ...

  2. Python中list,tuple,dict,set的区别和用法

    Python语言简洁明了,可以用较少的代码实现同样的功能.这其中Python的四个内置数据类型功不可没,他们即是list, tuple, dict, set.这里对他们进行一个简明的总结. List ...

  3. Python中list,tuple,dict,set的区别和用法(转)

    原文地址:http://www.cnblogs.com/soaringEveryday/p/5044007.html Python语言简洁明了,可以用较少的代码实现同样的功能.这其中Python的四个 ...

  4. Python的四个内置数据类型list, tuple, dict, set

    Python语言简洁明了,可以用较少的代码实现同样的功能.这其中Python的四个内置数据类型功不可没,他们即是list, tuple, dict, set.这里对他们进行一个简明的总结. List ...

  5. Python中的list,tuple,dict和set

    List list的创建与检索 Python内置的一种数据类型是列表:list.list是一种有序的集合,可以随时添加和删除其中的元素. 构造list非常简单,直接用 [ ] 把list的所有元素都括 ...

  6. day3------基本数据类型int, bool, str,list,tuple,dict

    基本数据类型(int, bool, str,list,tuple,dict) 一.python基本数据类型 1. int  整数. 主要用来进行数学运算 2. str  字符串, 可以保存少量数据并进 ...

  7. list,tuple,dict,set常用方法

    Python中list,tuple,dict,set常用方法 collections模块提供的其它有用扩展类型 from collections import Counter from collect ...

  8. python学习中,list/tuple/dict格式化遇到的问题

    昨天上了python培训的第一课,学习了基础知识.包括类型和赋值,函数type(),dir(),id(),help()的使用,list/tuple/dict的定义以及内置函数的操作,函数的定义,控制语 ...

  9. list,tuple,dict,set的增删改查

    数据结构 list tuple dict set 增 append insert    d['key']=value  add 删 pop pop(0)    d.pop('name') pop re ...

随机推荐

  1. UITextField 文本框 只能输入数字 且保留2位小数 实现

    http://blog.sina.com.cn/s/blog_aa7579f601015xvx.html #pragma mark - #pragma mark UITextField - (BOOL ...

  2. Hive常用非交互式命令

    [hadoop@hadoop hive-0.13.1]$ bin/hive -help usage: hive -d,--define <key=value> Variable subsi ...

  3. 高版本chrome不再支持window.showmodaldialog 的临时替换方案【用window.open】

    接管别人的项目,因开发时用了showmodaldialog 导致最近很多用户chrome升级到最新之后 就无法弹窗了.原因是新版chrome[37+]不再支持showmodaldialog. show ...

  4. VMware Workstation key

    VMware workstation 11 Pro key VY790-6FF9M-H8D3Q-1PY5T-YFUTD AA5M8-8NGD3-M805Y-K5Q7G-X28E6 UY3TR-88W4 ...

  5. AlertDialog用法。

    AlertDialog 可以在当前的界面弹出一个对话框,这个对话框是置顶于所有界面元素之上的,能够屏蔽掉其他控件的交互能力,因此一般 AlertDialog 都是用于提示一些非常重要的内容或者警告信息 ...

  6. PAT Advanced 1011 World Cup Betting (20 分)

    With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...

  7. C#的Class的几个修饰符

    none or internal     类只能在当前的工程中访问 Public                    类可以在任何地方访问 abstract or internal abstract ...

  8. php.ini中时区设置不成功解决方法

    一.在php.ini的[Date]中加入 [Date] date_default_timezone_set('UTC'); date.timezone = "Asia/Shanghai&qu ...

  9. onload + setTimeout 用法,制作广告弹框效果

    一般来说,只有 <body>,<img>, <link>, <script>,<frame>, <frameset>, < ...

  10. React Native 之ScrollView

    import React, { Component } from 'react' import { Text, StyleSheet, View, Button ,TouchableOpacity,A ...