Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 345 Bytes

154.md

File metadata and controls

22 lines (17 loc) · 345 Bytes
@author jackzhenguo
@desc
@tag
@version 
@date 2020/02/21

含单个元素的元组

Python中有些函数的参数类型为元组,其内有1个元素,这样创建是错误的:

c = (5) # NO!

它实际创建一个整型元素5,必须要在元素后加一个逗号:

c = (5,) # YES!
186