difference between and

0 votes
What is the difference between "*" and "**" operators?

In the following codes-

1. var= 2**2*3

2. var= 2*2*3

Both the codes give the same result. How are the two operators different?
Nov 19, 2018 in Python by ana1504.k
• 7,910 points
4,656 views

1 answer to this question.

0 votes
The "**" operator is used for 'power of" and "*" is used for multiplication.

Try-

var=2**3*2

and, var= 2*3*2 to see the difference. In your code 2**2 and 2*2 yields the same value.
answered Nov 19, 2018 by SDeb
• 13,300 points

Related Questions In Python

0 votes
1 answer

What's the difference in Qt between setVisible, setShown and show/hide

show() is just a convenience function for ...READ MORE

answered Apr 17, 2018 in Python by anonymous
9,380 views
0 votes
1 answer

What is the difference between list and tuple?

List has [ ] brackets while tuple ...READ MORE

answered May 11, 2021 in Python by Mohit Khurana

edited Mar 5, 2025 8,218 views
0 votes
1 answer

Difference between '==' and 'is'

'==' checks for the equality of the ...READ MORE

answered May 14, 2018 in Python by Nietzsche's daemon
• 4,260 points
1,421 views
0 votes
1 answer

Difference between pop and delete methods

Using delete leaves undefined holes in the ...READ MORE

answered Jan 18, 2022 in Python by saurabh thapa

edited Mar 5, 2025 2,929 views
0 votes
1 answer

How does % work in Python?

The % (modulo) operator yields the remainder ...READ MORE

answered Oct 10, 2018 in Python by SDeb
• 13,300 points
1,501 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 7,343 views
0 votes
2 answers

difference between class and instance attributes

Apart from the performance, there is a ...READ MORE

answered Sep 17, 2018 in Python by SDeb
• 13,300 points
1,604 views
0 votes
1 answer

Difference between module and Package in Python

A module is basically a single file ...READ MORE

answered Nov 13, 2018 in Python by SDeb
• 13,300 points
2,992 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP