What is the purpose of hash function in python?

0 votes
Can you give an example?

How is it different from dictionary in python? since dictionary is remotely considered as a hash map.
Jul 3 in Python by Waseem
• 4,480 points
53 views

1 answer to this question.

0 votes

The hash() method returns the hash value of an object if it has one. Hash values are just integers which are used to compare dictionary keys during a dictionary lookup quickly. Internally, hash() method calls __hash__() method of an object which are set by default for any object.

answered Aug 2 by Mohammad
• 3,170 points

Related Questions In Python

0 votes
1 answer

What is the use of raw_input function in Python?

raw_input fuction is no longer available in ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
138 views
+2 votes
6 answers

What exactly is the function of random.seed() in python?

The seed method is used to initialize the ...READ MORE

answered Oct 29, 2018 in Python by Rahul
37,517 views
0 votes
1 answer

What is the purpose of inner class in Python?

Advantages of inner class: Logical grouping of classes: ...READ MORE

answered Feb 7 in Python by SDeb
• 13,210 points
311 views
0 votes
0 answers

what is the purpose of the argument 'end' in the print function?

is it necessary to use this argument ...READ MORE

May 9 in Python by Waseem
• 4,480 points
20 views
+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 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 414 views
0 votes
2 answers

what is the procedure to the version of python in my computer?

Execute the following command on your terminal: python ...READ MORE

answered Mar 19 in Python by Alia
50 views
0 votes
1 answer

What is the patterns package in python used for?

Pattern is a web mining tool in ...READ MORE

answered Jul 31 in Python by Mohammad
• 3,170 points
36 views