string 포맷을 정렬하는 방법
def gugudan(n):
strFormat = '%-1s * %-1s = %+2s'
s = ''
for i in range(1,10):
s =''
for j in range(0,len(n)):
s += strFormat %(str(n[j]),str(i),str( int(n[j])*i))+" "
print(s)
while(True):
data = input().split()
result =[]
for j in range(0, len(data)):
if int(data[j]) <2 or int(data[j])>9:
print('INPUT ERROR!')
else:
result.append(data[j])
gugudan(result)
댓글 없음:
댓글 쓰기