From 80f1ecce929977a2e283d3f6812911689d11777b Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 27 Jan 2024 19:05:24 +0800 Subject: [PATCH] save project --- 2提取与修改.py | 5 +++++ T2.py | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 2提取与修改.py create mode 100644 T2.py diff --git "a/2\346\217\220\345\217\226\344\270\216\344\277\256\346\224\271.py" "b/2\346\217\220\345\217\226\344\270\216\344\277\256\346\224\271.py" new file mode 100644 index 0000000..abfbf22 --- /dev/null +++ "b/2\346\217\220\345\217\226\344\270\216\344\277\256\346\224\271.py" @@ -0,0 +1,5 @@ +dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} +print(dict_hero) +print(dict_hero['猴队长']) +dict_hero['猴七']=32 +print(dict_hero) \ No newline at end of file diff --git a/T2.py b/T2.py new file mode 100644 index 0000000..5973a36 --- /dev/null +++ b/T2.py @@ -0,0 +1,15 @@ +# name=input('你叫啥名啊?') +# power=int(input('你臂力多少呀啊?')) +# list_hero=["猴三",10,"猴一",21,"猴五",22,"猴队长",29,"猴七",30] +# for i in range(len(list_hero)): +# if i%2==1 and list_hero[i]>=power: +# list_hero.insert(i-1,name) +# list_hero.insert(i,power) +# break +# print(list_hero) + +dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} +print(dict_hero) +print(dict_hero['猴队长']) +dict_hero['猴七']=32 +print(dict_hero) \ No newline at end of file -- libgit2 0.25.0