How to implement Hashmaps in Python

0 votes
I want to implement a hashmap using python. The hashmap functions should be able to retrieve values from the hashmap created according to key-value pairs where the user enters the key and the output is the value paired along with it.

Can someone please guide me through this, I'm fairly new to python and programming as a whole.
Aug 31, 2018 in Python by ariaholic
• 7,320 points
72 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Python dictionary is a built-in type that supports key-value pairs.

streetno = {"1":"Sachine Tendulkar", "2":"Dravid", "3":"Sehwag", "4":"Laxman","5":"Kohli"}

as well as using the dict keyword:

streetno = dict({"1":"Sachine Tendulkar", "2":"Dravid"}) 

or:

streetno = {}
streetno["1"] = "Sachine Tendulkar"
answered Aug 31, 2018 by charlie_brown
• 7,710 points

Related Questions In Python

0 votes
1 answer

“stub” __objclass__ in a Python class how to implement it?

You want to avoid interfering with this ...READ MORE

answered Sep 27, 2018 in Python by Priyaj
• 56,120 points
30 views
0 votes
1 answer

How to implement Linked List in Python?

You can use Deque that works better than linked list ...READ MORE

answered Oct 26, 2018 in Python by Priyaj
• 56,120 points
24 views
0 votes
1 answer

How to implement Queue in python

You are missing this  from queue import * This ...READ MORE

answered Nov 2, 2018 in Python by Nabarupa
32 views
0 votes
1 answer

How to implement Stack in python

class Stack: def __init__(self): ...READ MORE

answered Nov 15, 2018 in Python by findingbugs
• 3,140 points
17 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
24 views
0 votes
1 answer

How to Print a List in Python

ou are using Python 2.x syntax with ...READ MORE

answered Aug 31, 2018 in Python by charlie_brown
• 7,710 points
38 views
0 votes
1 answer

Is there a foreach function in python and is there a way to implement it if there isnt any

Every occurence of "foreach" I've seen (PHP, ...READ MORE

answered Aug 31, 2018 in Python by charlie_brown
• 7,710 points
43 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.