ipv6 = input()
ipv6 = ipv6.split(':')
if ipv6[0] == '':
ipv6 = ipv6[1:]
if ipv6[-1] == '':
ipv6 = ipv6[:-1]
result = ''
for i in ipv6:
if i=='':
result += '0000:'*(8-len(ipv6)+1)
else:
result += i.zfill(4)+':'
print(result[:-1])
일단 이번 기회에 zfill이라는 함수를 알게되어 영광이다...
이거 몰라서 0 채우느라 매우 고생했다...
zfill함수는 자리수대로 0을 채워주는 함수인데, 난 몰랐지.
rjust(width,[fillchar])함수도 있던데
이 함수는 원하는 문자열로 채워넣을 수 있다!!