Learning Python - Pointers

preview_player
Показать описание
Python Pointers; or lack there of

If you liked this video Subscribe for more like it!

Donate to me directly, my paypal username is slimg00dy

Рекомендации по теме
Комментарии
Автор

made a 5 min video to tell python dosent have pointers?? seriously???

basictech
Автор

Hehe, try this:

a = [1, 2, 3]
b = a
a.append(4)
print(b)

Surprised? :)

frodobaggins
Автор

Thanks a lot. I have a test tomorrow and this is gonna help big time. Ty

thatlazyburger
Автор

As I got, when you assign 5 to x, you assign to x a memory location, where instance of int class is stored. Then, since int is unchangeable type of data, once you assign 9 to x, you create another instance of int class which is stored at another location. Variable y points to precedent memory location, where 5 is stored. Could you answer me, is there any practical way to pass inside a function a variable, change it inside the function so that global variable changes also ?

mykhailoshpakov
Автор

Is there a way to get value from id
For example lets say i do
x=10
y=id(x)

Now how can i print value of y because now if i print value of y it will be an integer which is memory

I want to print whats at that memory
Like address(&) in c

drac
Автор

Python does have pointers. Try your simple demonstration on "lists".

FreddieD-kp
Автор

Very good video, but It is also worth mentioning, pointers do exist for arrays or any other mutable object in python

Alireza
Автор

So, you just trolled me? I wanted to use pointers in python, I knew it wasn't possible, then I saw the title, got so happy, then... all went down... And btw C has pointers, that's stupid of you to be uncertain, C++ is just C but more OOP and with modern syntax, and more tools, only more tools, not like C++ has any more features.

shambhav
visit shbcf.ru