From 07696e9a257192db0f5c2d8a9b19c11f52480a45 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 4 Jun 2023 09:47:20 +0800 Subject: [PATCH] save project --- diy1.py | 10 ++++++++++ quiz.py | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 diy1.py create mode 100644 quiz.py diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..78df4a6 --- /dev/null +++ b/diy1.py @@ -0,0 +1,10 @@ +with open("C:\Users\maku\Desktop\1234.txt","r",encoding='uft-8')as a: + s=a.readlines() + +for i in s: + f=i.split() + sum=0 + for d in f[1:]: + sum=sum+int(d) + r=f[0]+str(sum) + print(r) \ No newline at end of file diff --git a/quiz.py b/quiz.py new file mode 100644 index 0000000..097fd92 --- /dev/null +++ b/quiz.py @@ -0,0 +1,5 @@ +# 直接运行以下代码,说说你的发现: +=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98] +dict_hlist_heroero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98} +print(len(list_hero)) +print(len(dict_hero)) \ No newline at end of file -- libgit2 0.25.0