Тёмный

Variables are pointers in Python 

Python Morsels
Подписаться 3,3 тыс.
Просмотров 455
50% 1

Python's variables are not buckets that contain objects; they're pointers. Assignment statements don't copy: they point a variable to a value (and multiple variables can "point" to the same value).
Article at pym.dev/variables-are-pointers/
More #Python screencasts at pym.dev/screencasts/
00:00 Changing two lists at once
01:09 Variables are separate from objects
01:38 Assignment statements don't copy
02:04 Explicitly copying a list
02:30 Variables are like pointers, not buckets

Наука

Опубликовано:

 

27 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@felixakwerh5189
@felixakwerh5189 25 дней назад
I really do hope your channel gets more subscribers and likes, you are good even for an experienced dev, your videos can still be a good reminder
@PythonMorsels
@PythonMorsels 25 дней назад
Thanks Felix! 😊
@lawrencerobinson6543
@lawrencerobinson6543 25 дней назад
Thank you for these "morsels. These videos are very helpful for someone just beginning python study. Much success to you.
@PythonMorsels
@PythonMorsels 25 дней назад
Thanks Lawrence! Much success to you in your Python learning journey as well!
@user-hk5zy3ug2q
@user-hk5zy3ug2q 25 дней назад
I really like the way you explain(I mean your speech).
@PythonMorsels
@PythonMorsels 25 дней назад
I'm glad to hear it. Thank you!
@AbhijitGangoly
@AbhijitGangoly 24 дня назад
What about: x: int = 5 y: int = x y = 2 print(x, y)
@PythonMorsels
@PythonMorsels 23 дня назад
That y variable was pointed to 5 and then pointed to 2 instead. I'll publish a video on the 2 types of "change" in Python in a few weeks which should clarify that example further. In the meantime the article pym.dev/pointers may help.
Далее
1 YEAR OF PYTHON CODING IN 1 MINUTE !!!!!
1:02
Просмотров 14 тыс.
5 Fun Python Easter Eggs
6:32
Просмотров 29 тыс.
BUZZ THE PLAYER OR SWIM 😅💦
00:35
Просмотров 5 млн
JavaScript DESTRUCTURING in 8 minutes! 💥
8:41
Просмотров 11 тыс.
ALL 11 LIST METHODS IN PYTHON EXPLAINED
9:23
Просмотров 73 тыс.
For loops in Python are easy 🔁
5:06
Просмотров 232 тыс.
3 Bad Python Habits To Avoid
10:40
Просмотров 45 тыс.
Using virtual environments in Python
3:58
Просмотров 1,1 тыс.
3 Mini Python Projects - For Beginners
53:53
Просмотров 325 тыс.
Любой звонок в AirPods
0:30
Просмотров 71 тыс.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Просмотров 8 млн
Живая клавиатура
0:56
Просмотров 39 тыс.