map

Difference between map and dict

Difference between map and dict Question: I might be confused between hashmap in Java, and map/dict in Python. I thought that the hash (k/v abstraction) of Java is kind of the same as dict in Python But then what does the map datatype do? Is it the same abstraction as the hashmap abstraction? If so, …

Total answers: 5

How to generate a list of 50 random colours in python?

How to generate a list of 50 random colours in python? Question: Given colour = [ “red”, “blue”, “green”, “yellow”, “purple”, “orange”, “white”, “black” ] generate and print a list of 50 random colours. You will need to use the random module to get random numbers. Use range and map to generated the required amount …

Total answers: 5