list = [
'abcd',
786,
2.23,
'runoob',
70.2]
tinylist = [
123,
'runoob']
print(
list)
print(
list[
0])
print(
list[
1:
3])
print(
list[
2:])
print(tinylist *
2)
print(
list + tinylist)
print(
"\n********************************\n")
a = [
1,
2,
3,
4,
5,
6];
a[
0] =
9
print(a[
0]);
a[
2:
5] = [
13,
14,
15]
print(a)
a[
2:
5] = []
print(a)
a =
list.copy()
print(a)
print(
list.count(
786))
print(a.reverse())
转载于:https://www.cnblogs.com/bilaisheng/p/10210954.html
转载请注明原文地址: https://mac.8miu.com/read-2166.html