Make a dictionary, the student's name is the key (a string) and the student's test scores is the value (a list). So it should be a dictionary with six key value pairs in it. Here is data to use. Brian,94,89,92 Rachel,100,90,65 Jon,67.5,95,100 Brit,0,78,80 Greg,65,100,78 Andrea,55.5,67,79 1. Now print the dictionary data using a loop that starts with for key, value in. 2. Now print the dictionary data using a loop that starts with for key in 3. Find and print out Rachels second score (should be a 90) 4. This one is a little tricky, a little mind-bender. Make a new dictionary. Using the dictionary you made from above,. the new dictionary should consist of the key is the name of the person, and the value is just the average of their scores. So it’s six key value pairs but instead of the value being a list like the first problems, this time it's just their average (which you compute from their scores in the other dictionary. Print the new dictionary out.
Make a dictionary, the student's name is the key (a string) and the student's test scores is the value (a list). So it should be a dictionary with six key value pairs in it. Here is data to use.
Brian,94,89,92
Rachel,100,90,65
Jon,67.5,95,100
Brit,0,78,80
Greg,65,100,78
Andrea,55.5,67,79
1. Now print the dictionary data using a loop that starts with
for key, value in.
2. Now print the dictionary data using a loop that starts with
for key in
3. Find and print out Rachels second score (should be a 90)
4. This one is a little tricky, a little mind-bender. Make a new dictionary. Using the dictionary you made from above,. the new dictionary should consist of the key is the name of the person, and the value is just the average of their scores. So it’s six key value pairs but instead of the value being a list like the first problems, this time it's just their average (which you compute from their scores in the other dictionary. Print the new dictionary out.
5. You can do this game alone, or do it in a group of up to three people max
You may work alone or with one or two other people on this one problem. If you work with one or two other people, please each turn in the same solution and indicate I did this project with so and so. You can work alone too, either way is fine.
You will create a free choice game. Your game will be using a PYTHON DICTIONARY
Make sure your game is original, ie: don’t take anything from the web. Don’t find a solution, just Make something up.
I will give you some ideas for a dictionary based game but you can do whatever you want.
- A word guessing game, where you try to guess answers
- A language translation game
- Some sort of a quiz or memorization game
The goal is to make sure you understand how to create, access and manipulate a Python dictionary. In the interest of time your games need not be too complicated. Keep it simple. I just need to get the overall impression that you understand how Python dictionaries work. Make sure to tell me what your game is, and include your source code and output.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images