Home > Software engineering >  Code run in a weird way in Visual Studio code (python)
Code run in a weird way in Visual Studio code (python)

Time:01-10

I'm wryting some code in VSC in python, and I've noticed a weird behavior:

mio_dict = {"Chiave1": "valore1", "Chiave2": "valore2", 29: 4}

mio_dict.get(4, "key not found")
mio_dict.get(29, "key not found")

Basically, if I've only mio_dict.get(4, "chiave non trovata"), it replies correctly, but if I`ve both as in the block, it replies only with the second result, as the first isn't there...any ideas why?

Similarly, in the terminal sometimes it doesn't work at all, but in the interactive shell yes...why???

Thank you

CodePudding user response:

Your question is somewhat vague. First, please clarify the definition of enter image description here

  • Related