In this part, we're going to revisit the topic of mutable and immutable objects. This concept is masked pretty well in Python, which, like dynamic typing, can be great... or not. It can really bite you one day if you don't have a good understanding of how it works, so let's talk about it.
Playlist: • Learning to program with Python 3 (py 3.7)
#python #programming #tutorial
quiz:
x = 1
def test():
x = 2
test()
print(x)
x = 1
def test():
global x
x = 2
test()
print(x)
x = [1]
def test():
x = [2]
test()
print(x)
x = [1]
def test():
global x
x = [2]
test()
print(x)
x = [1]
def test():
x[0] = 2
test()
print(x)
En esta página del sitio puede ver el video en línea Mutability revisited - Python 3 Programming Tutorial p.8 de Duración hora minuto segunda en buena calidad , que subió el usuario sentdex 01 enero 1970, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 113,589 veces y le gustó 1.7 mil a los espectadores. Disfruta viendo!