当前位置:网站首页>Basic knowledge of tuples
Basic knowledge of tuples
2022-07-05 03:17:00 【Programming is too difficult】
Catalog
Definition of tuple
Tuples :tuple
If you want to create an empty tuple , Don't write anything in brackets .
If there is only one data in the tuple , Then remember to add a comma .
If there is more than one data in the tuple , Data are separated by commas , There is no need to add a comma after the last data .
Access to tuple elements
Access to elements in tuples and list equally , Can be accessed by subscript .
Fill in brackets with -1 Indicates access to the last data ,list The same in China .
list And tuples can be sliced . Write... In brackets [ Start subscript : Terminate subscript ( But does not contain ): Step value ].
Basic operations on tuples
increase
You can connect two tuples with a plus sign , Open up a space to store the content after the connection .
Delete
use del After deleting tuples , The entire variable will be deleted , An error will be reported when using this variable next time , Indicates that this variable has not been defined .
modify
Data in tuples cannot be modified , however list Data that can be used as tuples ,list The data in can be modified .
lookup
The search operation is to traverse the data in tuples , By subscript operation .
Other operating
Tuples can also be like list Same count ,tup.count()
To turn a variable into a tuple , Write the variable name directly in tuple() In parentheses .
边栏推荐
- El select, El option drop-down selection box
- Daily question 2 12
- [groovy] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
- Master Fur
- When sqlacodegen generates a model, how to solve the problem that the password contains special characters?
- [micro service SCG] 33 usages of filters
- Design of KTV intelligent dimming system based on MCU
- Yyds dry goods inventory embedded matrix
- Devtools的簡單使用
- 单项框 复选框
猜你喜欢
Acwing第 58 场周赛【完结】
SQL performance optimization skills
New interesting test applet source code_ Test available
Qrcode: generate QR code from text
Design and practice of kubernetes cluster and application monitoring scheme
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Design and implementation of high availability website architecture
Elk log analysis system
IPv6 experiment
Azkaban实战
随机推荐
ELFK部署
this+闭包+作用域 面试题
【微服务|SCG】Filters的33种用法
Basic authorization command for Curl
1. Five layer network model
Vb+access hotel service management system
[Chongqing Guangdong education] 2777t green space planning reference questions of National Open University in autumn 2018
D3js notes
This + closure + scope interview question
Flume configuration 4 - customize mysqlsource
Azkaban概述
Yyds dry goods inventory intelligent fan based on CC2530 design
El select, El option drop-down selection box
[groovy] string (string injection function | asBoolean | execute | minus)
Last words record
What is the most effective way to convert int to string- What is the most efficient way to convert an int to a String?
Talk about the SQL server version of DTM sub transaction barrier function
Six stone programming: advantages of automated testing
有個疑問 flink sql cdc 的話可以設置並行度麼, 並行度大於1會有順序問題吧?
Design of KTV intelligent dimming system based on MCU