# Display the List

**URL:** https://discuss.python.org/t/display-the-list/13334
**Category:** Python Help
**Tags:** help
**Created:** [January 25, 2022, 12:55pm UTC](https://discuss.python.org/t/display-the-list/13334 "2022-01-25T12:55:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vhegde](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vhegde/32/6072_2.png) [@vhegde](https://discuss.python.org/u/vhegde)
#### Post date: [January 25, 2022, 12:55pm UTC](https://discuss.python.org/t/display-the-list/13334/1 "2022-01-25T12:55:53Z")

</div>

Hi,

I have a List based on the user input.[‘r’, ‘r’, ‘r’, ‘r’, ‘s’, ‘S’, ‘P’, ‘P’, ‘s’, ‘s’, ‘p’]  
I want to print this list as[“Rock”,Rock",Rock",Rock",Scissors",Scissors", “Paper”, “Paper”,“Scissors”,Scissors",“Paper”] depending on the user input.  
The user input may change. I want to display whatever user enters in terms of [“Rock”, “Paper”, “Scissors”].  
Could you please help me with this?

---

<div class="post-metadata">

### Author: ![cameron](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cameron/32/2658_2.png) [@cameron](https://discuss.python.org/u/cameron)
#### Post date: [January 25, 2022, 9:52pm UTC](https://discuss.python.org/t/display-the-list/13334/2 "2022-01-25T21:52:24Z")

</div>

We can and will help, but this looks very much like a homework exercise.  
We ask that you supply your attempt at this and ask questions, as the  
point is to learn by solving the problem yourself.

You have a list of inputs. You want them associated with words like  
“Rock” etc. The normal way to do this in Python is with a mapping,  
usually a dict, which is an object with keys (such as “r”) and  
associated values (such as “Rock”). Example:

```
wordmap = {
    'a': 'apple',
    'b': 'banana',
}

```

When you access a mapping via a key your get a value:

```
f = 'a'
fruit = wordmap[f]
print(f, fruit)

```

should print:

```
a apple

```

Try writing some code on that basis and see how it goes. Return with the  
code and questions. If you have error tracebacks, include them  
_completely_. Please don’t use screenshots, instead copy/paste the code  
(and/or traceback) into the message as text between triple backticks:

````
```
your pasted stuff here
```

````

Cheers,  
Cameron Simpson [cs@cskk.id.au](mailto:cs@cskk.id.au)
