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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
C
Check Point Blog
M
MIT News - Artificial intelligence
T
The Blog of Author Tim Ferriss
Jina AI
Jina AI
博客园 - 【当耐特】
U
Unit 42
月光博客
月光博客
腾讯CDC
Y
Y Combinator Blog
小众软件
小众软件
博客园_首页
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
T
Tailwind CSS Blog

噜啦 - 序列

序列 元组的基本操作 - 噜啦 序列 列表的基本操作 - 噜啦 序列 列表的基本操作 - 噜啦 序列 字符串基本操作 - 噜啦 序列 字符串基本操作 - 噜啦 序列 字符串 - 噜啦 序列 字符串 - 噜啦
序列 元组的基本操作 - 噜啦
博主: 噜啦 · 2019-09-06 · via 噜啦 - 序列

题目

# 练习四 元组的基本操作

# 1. 定义一个任意元组,对元组使用append() 查看错误信息
# 2. 访问元组中的倒数第二个元素
# 3. 定义一个新的元组,和 1. 的元组连接成一个新的元组
# 4. 计算元组元素个数

答案

a_list = ('x', 'y', 3, 4, 5)
# a_list.append('1111')
print(a_list)
print(a_list[-2])
b_list = ('aaaa', 'bbb')
print(a_list + b_list)
print(len(a_list))

运行

赞赏作者

如果觉得我的文章对你有用,请随意赞赏