启动
This commit is contained in:
15
day4/TODO.py
Normal file
15
day4/TODO.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
list=['原神']
|
||||||
|
for i in list:
|
||||||
|
list.append(input('何事?'))
|
||||||
|
a=input('何事终了?')
|
||||||
|
if a in list:
|
||||||
|
list.remove(a)
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
print('未尽之事:',list)
|
||||||
|
b = input('是否下一周目(1是2否)')
|
||||||
|
if b == 1:
|
||||||
|
continue;
|
||||||
|
else:
|
||||||
|
print('未尽之事:',list)
|
||||||
|
break;
|
||||||
10
day4/列表.py
10
day4/列表.py
@ -0,0 +1,10 @@
|
|||||||
|
a = ["b",2,3]
|
||||||
|
a.remove("b")#直接删
|
||||||
|
del a[0]#删索引值无[]默认整个列表
|
||||||
|
a.pop(0)#删索引值(用法同上)
|
||||||
|
a.clear()#清空
|
||||||
|
a.append(input(""))#添加
|
||||||
|
a[0]=''#更改第"0"个
|
||||||
|
a.sort()#按顺序整理
|
||||||
|
a.reverse()#翻转
|
||||||
|
len(a)
|
||||||
Reference in New Issue
Block a user