[Python applying learnings from 1..6] update file(add space)

This commit is contained in:
kjg 2020-06-01 23:43:40 +09:00
parent 9c7d1f4909
commit f7e0d8cb08
2 changed files with 4 additions and 2 deletions

View File

@ -12,11 +12,11 @@ def input_and_calculate_one_line():
sp_number = number.split(' ')
for i in range(len(sp_number) - 1):
txt_result = txt_result + sp_number[i] + '+'
txt_result = txt_result + sp_number[i] + ' + '
sp_number = list(map(int, sp_number))
result = sum(sp_number)
txt_result = txt_result + str(sp_number[-1]) + '=' + str(result) + '\n'
txt_result = txt_result + str(sp_number[-1]) + ' = ' + str(result) + '\n'
return txt_result

View File

@ -133,3 +133,5 @@ How to use Accessing Elements of Lists
practice function, while, if
**** ex36
some rules of if, loop and tips for debugging
*** Python applying learnings from 1..6
create calc.py