vendredi 20 novembre 2020

Python- code block goes to the if but to the else block as well- Why?

can someone told me why this code goes to the if block but even if I select one of the 3 options it goes to the else block as well?

elige = "diccionario"
dict = {1:"Emiliano", 2: "Grama", "Fastlaner": "Volviendo a programar"}
tupla = ("Lista", "Fija", "de","mie",1)
lista = ["sera","una","list"]
result = ""

if elige == "diccionary" :
    dict[2] = "que chor"
    result = dict
    print (result)

if elige == "Tuple" :
    result = tupla
    print ("he aqui tu tupla")
    print (result)

if elige == "list" :
    result = lista
    print(result)

else:
    print("no fue por ningun camino che")
    print(result)

Aucun commentaire:

Enregistrer un commentaire