>>> def Soma(*valores): r = 0
for i in valores: r += i return r
>>> Soma(3, 9) 12
>>> Soma(1, 2, 3, 4) 10
>>> Soma(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) 12
O meu:
def Soma (*valores):
r = 0
for i in valores:
r+=i
return r
Soma(3, 9)
Traceback (most recent call last):
line 63, in runsource
code = self.compile(source, filename, symbol)
line 185, in __call__
return _maybe_compile(self.compiler, source, filename, symbol)
line 102, in _maybe_compile
raise err1
line 91, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
line 150, in __call__
codeob = compile(source, filename, symbol, self.flags, True)
File "<input>", line 3
for i in valores:
IndentationError: unexpected indent
Pergunta
dneto
Boa tarde!
O original:
>>> def Soma(*valores): r = 0
for i in valores: r += i return r
>>> Soma(3, 9) 12
>>> Soma(1, 2, 3, 4) 10
>>> Soma(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) 12
O meu:
def Soma (*valores):
r = 0
for i in valores:
r+=i
return r
Soma(3, 9)
Traceback (most recent call last):
line 63, in runsource
code = self.compile(source, filename, symbol)
line 185, in __call__
return _maybe_compile(self.compiler, source, filename, symbol)
line 102, in _maybe_compile
raise err1
line 91, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
line 150, in __call__
codeob = compile(source, filename, symbol, self.flags, True)
File "<input>", line 3
for i in valores:
IndentationError: unexpected indent
O que está errado no meu programa?
Obrigado!
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.