程序会读入两行,每行都是一个数字,输出这两个数字的和

实现

#!/usr/bin/env python3
#-*- codin:utf-8 -*-

ls=[0,0]
try:
    i=0
    while i<2:
        ls[i]=int(input())
        i+=1
except:
    sum='The data\'s type of inputing is error! '
finally:
    print(f"{sum(ls)}")

输出

1
3
4

Q.E.D.


仰望星空,还需脚踏实地。