Mutability revisited - Python 3 Programming Tutorial p.8

Publié le: 01 janvier 1970
sur la chaîne: sentdex
113,589
1.7k

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)


Sur cette page du site, vous pouvez voir la vidéo en ligne Mutability revisited - Python 3 Programming Tutorial p.8 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur sentdex 01 janvier 1970, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 113,589 fois et il a aimé 1.7 mille téléspectateurs. Bon visionnage!