from math import ceil
def escrita_colunas( textos, colunas) :
linhas_coluna = ceil( len ( textos) /colunas)
tamanho_max = 0
for texto in textos:
tamanho = len ( texto) + 1
if tamanho > tamanho_max:
tamanho_max = tamanho
escritas = [ '' ] * linhas_coluna
linha = 0
for texto in textos:
if linha == linhas_coluna:
linha = 0
carateres_faltam = tamanho_max - len ( texto)
texto_inserir = texto + ( ' ' * carateres_faltam)
escritas[ linha] = escritas[ linha] + texto_inserir
linha = linha + 1
for escrita in escritas:
print ( escrita)
textos = [ '1 ano: Bodas de Ágata' ,
'2 anos: Bodas de Água-Marinha' ,
'3 anos: Bodas de Âmbar' ,
'4 anos: Bodas de Alabastro' ,
'5 anos: Bodas de Alexandrita' ,
'6 anos: Bodas de Amazônia' ,
'7 anos: Bodas de Ametista' ,
'8 anos: Bodas de Andaluzite' ,
'9 anos: Bodas de Aventurina' ,
'10 anos: Bodas de Axinite' ]
escrita_colunas( textos, 2 )
ZnJvbSBtYXRoIGltcG9ydCBjZWlsCgpkZWYgZXNjcml0YV9jb2x1bmFzKHRleHRvcywgY29sdW5hcyk6CiAgICBsaW5oYXNfY29sdW5hID0gY2VpbChsZW4odGV4dG9zKS9jb2x1bmFzKQogICAgCiAgICB0YW1hbmhvX21heCA9IDAKICAgIGZvciB0ZXh0byBpbiB0ZXh0b3M6CiAgICAJdGFtYW5obyA9IGxlbih0ZXh0bykgKyAxCiAgICAJaWYgdGFtYW5obyA+IHRhbWFuaG9fbWF4OgogICAgCQl0YW1hbmhvX21heCA9IHRhbWFuaG8KICAgIAkJCiAgICBlc2NyaXRhcyA9IFsnJ10gKiBsaW5oYXNfY29sdW5hCgogICAgbGluaGEgPSAwCiAgICBmb3IgdGV4dG8gaW4gdGV4dG9zOgogICAgICAgIGlmIGxpbmhhID09IGxpbmhhc19jb2x1bmE6CiAgICAgICAgICAgIGxpbmhhID0gMAogICAgICAgICAgICAKICAgICAgICAKICAgICAgICBjYXJhdGVyZXNfZmFsdGFtID0gdGFtYW5ob19tYXggLSBsZW4odGV4dG8pCiAgICAgICAgdGV4dG9faW5zZXJpciA9IHRleHRvICsgKCcgJyAqIGNhcmF0ZXJlc19mYWx0YW0pCiAgICAgICAgCiAgICAgICAgZXNjcml0YXNbbGluaGFdID0gZXNjcml0YXNbbGluaGFdICsgdGV4dG9faW5zZXJpcgogICAgICAgIGxpbmhhID0gbGluaGEgKyAxCiAgICAgICAgCgogICAgZm9yIGVzY3JpdGEgaW4gZXNjcml0YXM6CiAgICAgICAgcHJpbnQoZXNjcml0YSkKCnRleHRvcyA9IFsnMSBhbm86IEJvZGFzIGRlIMOBZ2F0YScsIAoJICAgICAgJzIgYW5vczogQm9kYXMgZGUgw4FndWEtTWFyaW5oYScsIAoJICAgICAgJzMgYW5vczogQm9kYXMgZGUgw4JtYmFyJywgCgkgICAgICAnNCBhbm9zOiBCb2RhcyBkZSBBbGFiYXN0cm8nLCAKCSAgICAgICc1IGFub3M6IEJvZGFzIGRlIEFsZXhhbmRyaXRhJywgCgkgICAgICAnNiBhbm9zOiBCb2RhcyBkZSBBbWF6w7RuaWEnLCAKCSAgICAgICc3IGFub3M6IEJvZGFzIGRlIEFtZXRpc3RhJywgCgkgICAgICAnOCBhbm9zOiBCb2RhcyBkZSBBbmRhbHV6aXRlJywgCgkgICAgICAnOSBhbm9zOiBCb2RhcyBkZSBBdmVudHVyaW5hJywgCgkgICAgICAnMTAgYW5vczogQm9kYXMgZGUgQXhpbml0ZSddCgkgICAgICAKZXNjcml0YV9jb2x1bmFzKHRleHRvcywgMik=