Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 661419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:15:53+00:00 2026-05-13T23:15:53+00:00

I found a suggestion on a Stack Overflow topic about problems beginners should do

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:15:54+00:00Added an answer on May 13, 2026 at 11:15 pm

    You need to define some more parameters before you can tackle this problem.

    • Are phone numbers unique to each person?
    • How will you store names? First name and last name in different strings? All in one string?
    • Do you want to support fuzzy matching?
    • do you want to offer reverse lookup functionality? (I.E. look up a person based on a phone number?)

    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:

    import random
    import string
    
    minLength = 5 # the minimum length of the string.
    maxLength = 15 # the maximum length of the string
    
    randstring = string.join([random.choice(string.lowercase)
        for i in range(random.randrange(minlength,maxlength+1))], '')
    

    To do the same with numbers, just replace random.lowercase with [1,2,3,4,5,6,7,8,9,0]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very famous questions in Google. I found several suggestion to achieve
FOUND THE ANSWER MYSELF, see below... I'd like to have a very simple user
I found that in the cocos2d Best Practices there is a suggestion to use
Found related questions but not the exact variant so I am posting a very
Found This: tyty stack, Social Icons not working with Infinite Scrolling on Wordpress I'm
I found this thread on StackOverflow about how to get the Application Root from
I'm trying to use target-counter to describe references. I found out about it from
This is my first stack overflow quesiton, so if i'm not posting correctly, or
I have a reputation system on my site, similar to Stack Overflow, where a
I browsed around here on Stackoverflow and found this topic : https://stackoverflow.com/questions/279/aspnet-visual-studio-and-subversion-how-to-integrate However that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.