data = '28122016' dia = int(data[:2])mes = int(data[2:4])ano = int(data[4:]) print('{:4d}-{:2d}-{:2d}'.format(ano, mes, dia))
Standard input is empty
2016-12-28
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!