[Python] Multiple variables using tuple

Discussão em 'Python' iniciado por Stack, Abril 8, 2025.

  1. Stack

    Stack Membro Participativo

    I was reading about tuple:


    Once created, the values of a tuple cannot change.

    If you want to assign multiple variables at once, you can use tuples:

    name,age,country,career = ('Diana',32,'Canada','CompSci')
    print(country)​

    I did this..

    country = 'India'
    print(country)


    and it's modified. How come?

    Continue reading...

Compartilhe esta Página