| Blasted |
Portugal@Home Member
Olá a todos!
Estou a iniciar-me no mundo de phyton. Há algum tempo atrás andei, também por aqui, a pesquisar sobre com que linguagem começar e acabei por começar com Phyton pois pareceu-me a mais adequada.
Bem, estou a ler um livro (que por sinal até estou a achar muito bom) que com o avançar da matéria vai incluindo sempre exercicios para o 'aluno' resolver.
Um deles é este:
Portanto, o que está mal?
Estou a iniciar-me no mundo de phyton. Há algum tempo atrás andei, também por aqui, a pesquisar sobre com que linguagem começar e acabei por começar com Phyton pois pareceu-me a mais adequada.
Bem, estou a ler um livro (que por sinal até estou a achar muito bom) que com o avançar da matéria vai incluindo sempre exercicios para o 'aluno' resolver.
Um deles é este:
Tentei resolver o exercicio e fiz este código:Python provides a built-in function called len that returns the length of
a string, so the value of len('allen') is 5.
Write a function named right justify that takes a string named s as a parameter and
that prints the string with enough leading spaces so that the last letter of the string is in
column 70 of the display.
Ao tentar correr este código dá-me erro e como novato que sou ainda não estou bem na parte onde percebo exactamente onde errei e percebo o que o interpretador me dizdef right_justify(arg):
. len('arg') = 70
. print arg
right_justify('qualquer_coisa')
Portanto, o que está mal?