0

I've been reading a book on a programming language, and there's an example of creating a data structure in which the names and programming language corresponding to the name are stored

so it looks like this:

favorite_languages = {
    "jen": "C",
    "mark": "Ruby",
    "denis": "Python",
    "adnrew": "C#",
    }

And to access the value (programming language) you need to write a key (name of a person in this case).

So if I want to see what's denis's favorite programming language I shall write this

favorite_languages["denis"]

In the book it says

"To use this data structure, given the name of a person who took the poll, you can easily look up their favorite language"

So the core of my question is what does given mean here?

I can't really comprehend it even using online translator.

1
  • given X = IF I / we / you have X Jan 8 at 13:31

1 Answer 1

1

'Given' here means 'if you are given'. If you are given someone's name, you can easily look up their favourite language.

Imagine that I work in the school office. If someone gives me [or if I am given, or just given] a student's name, I can consult the database and tell you that person's date of birth, height, home address, etc.

Given a car, I could drive to my mother's house.

My daughter is a genius. Given any number, she will tell you its square root at once.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .