回答編集履歴

1

追記

2022/08/21 19:14

投稿

退会済みユーザー
test CHANGED
@@ -12,3 +12,19 @@
12
12
  ```
13
13
  https://replit.com/@su507/eg0qufagd0gggx#main.py
14
14
 
15
+ **追記**
16
+
17
+ またはこうとか:
18
+ ```Python
19
+ list_r = [3,5,9,13,16,22]
20
+ list_s = []
21
+
22
+ with open("sample.txt") as f:
23
+ lines = f.readlines()
24
+ list_s = [lines[n-1].strip() for n in list_r]
25
+
26
+ print(list_s)
27
+
28
+ ```
29
+ https://replit.com/@su507/eg0qufagd0gggx-2#main.py
30
+