output function giving error syntax

Asked

Viewed 69 times

0

lista1 = [1,2,3,1,1]
lista2 = [2,2,3,1,3]
res = list(input("Digite seus inteiros"))
def exibiçao(lista1,lista2,res):

print("{} {} {} {} {}".format(lista1[4],lista1[3],lista1[2],lista1[1],lista1[0] ))
print("{} {} {} {} {}".format(lista2[4],lista2[3],lista2[2],lista2[1],lista2[0] ))
print("--------------------------")
print("{} {} {} {} {}".format(res[4],res[3],res[2],res[1],res[0] ))

1 answer

1

Avoid Latin words, as display, if you want to keep the name display without the accent, remember that the English language does not have such graphic signs.

Also, you forgot to close relatives, as a consequence of this act occurred errors.

I hope I’ve helped.

lista1 = [1, 2, 3, 1, 1]
lista2 = [2, 2, 3, 1, 3]
res = [3, 4, 6, 2, 4]


def exibicao(lista):

  return len(lista)


print("{}, {}, {}, {}, {} ".format(lista1[4], lista1[3], lista1[2], lista1[1], lista1[0]))

print("{}, {}, {}, {}, {}".format(lista2[4], lista2[3], lista2[2], lista2[1], lista2[0]))

print("Tamanho da lista igual a ", exibicao(lista2))

print("{}, {}, {}, {}, {}".format(res[4], res[3], res[2], res[1], res[0]))

  • if my res were entered by the user how to solve ?

  • just pass the Rest list as parameter. For example: display(Rest). That is, you can enter any parameter by following the same type of variable.

  • exactly q the Andre said

  • 2

    I don’t see why not use accents in the function - python normally accepts that, so this kind of recommendation makes no sense in that language.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.