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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
A
About on SuperTechFans
腾讯CDC
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
I
InfoQ
博客园 - 【当耐特】
美团技术团队
GbyAI
GbyAI
量子位
宝玉的分享
宝玉的分享
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - Franky
L
LangChain 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))

运行

赞赏作者

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