Mutability revisited - Python 3 Programming Tutorial p.8

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: 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)


Auf dieser Seite können Sie das Online-Video Mutability revisited - Python 3 Programming Tutorial p.8 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer sentdex 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 113,589 Mal angesehen und es wurde von 1.7 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!