I found a suggestion on a Stack Overflow topic about problems beginners should do to learn a new language. A user posted a very nice list of problems from Beginner to advanced that should help you get to know a language. One of the problems is to create a phone book, with random phone numbers and random people on the phone book, and a user should be able to search a phone number and find the person, and vice-versa.
So how do you randomly generate x amount of values and store them, without a database, specifically focusing on Python and Ruby.
You need to define some more parameters before you can tackle this problem.
In Python, you could do all of this with sets, lists, and/or dicts, but you might also look into the sqlite3 module.
To generate a random string of letters in Python you do:
To do the same with numbers, just replace random.lowercase with [1,2,3,4,5,6,7,8,9,0]