In [ ]:
n=input()
a=n.split(",")
b=[(sum(int(i[k]) for k in range(len(i)))) for i in a]
d=dict(zip(a,b))
for i in d:
print(i,"~",d[i])
In [ ]:
N=(int)(input())
sequence=[[i+int((N*j)-((j*(j+1))/2))
for j in range(0,i)]
for i in range(1,N+1)]
for i in sequence:
for j in i:
print(j,end=" ")
print()