diff --git a/code/grid2.py b/code/grid2.py new file mode 100644 index 0000000..3aaa7e6 --- /dev/null +++ b/code/grid2.py @@ -0,0 +1,10 @@ +def grid(l=4,c=4): + l1 = '+' + '-' * c + '+' + '-' * c + '+' + ln = '|' + ' ' * c + '|' + ' ' * c + '|' + print(l1) + for i in range(l): + print(ln) + print(l1) + for i in range(l): + print(ln) + print(l1) diff --git a/code/right_justify.py b/code/right_justify.py new file mode 100644 index 0000000..51fb02d --- /dev/null +++ b/code/right_justify.py @@ -0,0 +1,9 @@ +""" + 3.1 Escreva uma função chamada right_justify, que receba uma string chamada s como parametro + e exiba a string com espaços suficientes à frente para que a ultima letra da string esteja na + coluna 70 da tela +""" +def rigth_justify(s,n=70): + return (' ' * len(s) + s[:])*(n//(len(s)*2)) + +rigth_justify('monty')