first commit
This commit is contained in:
parent
abc6526143
commit
26631f9b48
24 changed files with 1089 additions and 1 deletions
15
Exercise/exercise-4.2.py
Normal file
15
Exercise/exercise-4.2.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# 给定一组整数,计算他们的和并输出等式
|
||||
|
||||
magic_number_list = [4, 8, 15, 16, 23, 42]
|
||||
|
||||
sum = 0
|
||||
expression = ''
|
||||
for index in range(len(magic_number_list)):
|
||||
print(index)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 应输出4 + 8 + 15 + 16 + 23 + 42 = 108
|
||||
print(expression)
|
||||
Loading…
Add table
Add a link
Reference in a new issue