惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
月光博客
月光博客
Last Week in AI
Last Week in AI
D
DataBreaches.Net
MyScale Blog
MyScale Blog
The Register - Security
The Register - Security
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Check Point Blog
V
V2EX
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
小众软件
小众软件
博客园 - 叶小钗
A
Arctic Wolf
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
Martin Fowler
Martin Fowler
Simon Willison's Weblog
Simon Willison's Weblog
Security Latest
Security Latest
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
Know Your Adversary
Know Your Adversary
N
Netflix TechBlog - Medium
Recorded Future
Recorded Future
B
Blog RSS Feed
T
Tenable Blog
S
Secure Thoughts
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
PCI Perspectives
PCI Perspectives
T
Tor Project blog
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Fortinet All Blogs
Webroot Blog
Webroot Blog
T
Threat Research - Cisco Blogs

博客园 - YiYezc

Python的if语句 Python列表操作 Python列表管理 Python列表元素管理 Python字符串 Python变量 centos安装autossh bash相关 Linux的bash快捷键 Vim程序编辑器 Linux下光盘镜像生成和刻录 Linux文件系统备份dump Linux下文件压缩与打包 Linux挂载 Linux磁盘分区 Linux文件访问和日志 block、inode、superblock详解 Linux文件系统的详解 Linux的权限对于文件与目录的意义 命令与文件的查询 ctime, atime与mtime释疑 Linux下文件特殊权限 umask相关内容
Python元组
YiYezc · 2026-04-24 · via 博客园 - YiYezc

1.元组定义

元组是不可变的列表

nums=(100,200)

可以使用索引得到元素,但是不能使用索引对元素进行修改

print(nums[0]) √

nums[0]=10 ×

2.编列元组

同列表

for num in nums:

    print(num)

3.元组重新赋值

重新定义即可,不能对单一元素进行修改

nums=(100,200)

for num in nums:

    print(num)

nums=(300,400)

for num in nums:

    print(num)

执行得到:

100

200

300

400

posted @ 2026-04-24 11:08  YiYezc  阅读(5)  评论(0)    收藏  举报