Do we have pointers in python like other programming languages

0 votes
is there a difference between pointers in python and other programming language?

does pointers in python exist?
Mar 12, 2019 in Python by Waseem
• 4,540 points
11,886 views

2 answers to this question.

0 votes

Hello

No, we don't have any kind of Pointer in Python language.The objects are passed to function by reference. The mechanism used in Python is exactly like passing pointers by the value in C. We have Python variables which is not a pointer.

answered Mar 12, 2019 by MrBoot
• 1,270 points
0 votes

From one point of view, everything is a pointer in Python. Your example works a lot like the C++ code. (A closer equivalent would use some type of shared_ptr<Object> instead of int* .)

Python doesn't need pointers in order to achieve this as every variable is a reference to an object. These references are slightly different from C++ references, in that they can be assigned to - much like pointers in C++. Python standard way of handling things supports you. In python every variable is a reference.

answered Dec 16, 2020 by Gitika
• 65,870 points

Related Questions In Python

0 votes
2 answers

Why do we use return statement in python?

def maximum(x, y):     if x > y:     ...READ MORE

answered Apr 4, 2019 in Python by anonymous
596 views
0 votes
1 answer

Why do variables have bigger scopes in Python than in C?

Only functions, modules, and the bodies of ...READ MORE

answered Jul 2, 2019 in Python by SDeb
• 13,270 points
186 views
0 votes
1 answer

How can we do the below modulo operation in python guys?

Expecting some operations, not loop. As because of ...READ MORE

answered Oct 14, 2020 in Python by anonymous
• 65,870 points
66 views
0 votes
1 answer

Why do we not follow the "off by one" rule in python

It's because of the way in which ...READ MORE

answered Nov 15, 2020 in Python by Gitika
• 65,870 points
75 views
+4 votes
6 answers

Does Python have a ternary conditional operator like C does?

Yes, the syntax is: a if condition else ...READ MORE

answered Apr 13, 2018 in Python by Nietzsche's daemon
• 4,260 points
529 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,976 views
0 votes
0 answers
0 votes
2 answers

what is a class method in python?

Class Method  class method is the method which is ...READ MORE

answered Apr 8, 2019 in Python by MrBoot
• 1,270 points
213 views