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

推荐订阅源

Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
S
Securelist
The Hacker News
The Hacker News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs
Jina AI
Jina AI
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Webroot Blog
Webroot Blog
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
量子位
S
Schneier on Security
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
O
OpenAI News
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
博客园 - 叶小钗
L
LINUX DO - 最新话题
V
Visual Studio Blog
U
Unit 42
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security Affairs
AWS News Blog
AWS News Blog
S
Secure Thoughts
腾讯CDC
Cloudbric
Cloudbric
H
Help Net Security
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
C
Cyber Attacks, Cyber Crime and Cyber Security
WordPress大学
WordPress大学
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 【当耐特】
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
D
DataBreaches.Net
A
About on SuperTechFans
G
GRAHAM CLULEY
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Martin Fowler
Martin Fowler
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
NISL@THU
NISL@THU
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary

博客园 - 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)    收藏  举报