You are to present your findings in the form of a problem based report. This report should describe how you approached the solution to the problem (program design), how you implemented the program (source code and screen shots) and the approach you used to test that the program works (you should include a print out of your test results as part of the report). You will also evaluate how effective your solution is, and where you feel any improvements could be made.
1. Create a list called years_list, starting with the year of your birth, and each year
thereafter until the year of your fifth birthday. For example, if you were born in 1980 the list would be years_list = [1980, 1981, 1982, 1983, 1984, 1985].
2. In which year in years_list was your third birthday? Remember, you were 0 years of age for your first year.
3. In which year in years_list were you the oldest?
4. Make a list called things with these three strings as elements: "mozzarella", "cinderella", "salmonella".
5. Capitalize the element in things that refers to a person and then print the list. Did it change the element in the list?
6. Make the cheesy element of things all uppercase and then print the list.
7. Delete the disease element from things, collect your Nobel Prize, and print the list.
8. Create a list called surprise with the elements "Groucho", "Chico", and "Harpo".
9. Lowercase the last element of the surprise list, reverse it, and then capitalize it.
10. Make an English-to-French dictionary called e2f and print it. Here are your starter words: dog is chien, cat is chat, and walrus is morse.
11. Using your three-word dictionary e2f, print the French word for walrus.
12. Make a French-to-English dictionary called f2e from e2f. Use the items method.
13. Using f2e, print the English equivalent of the French word chien.
14. Make and print a set of English words from the keys in e2f.
15. Make a multilevel dictionary called life. Use these strings for the topmost keys: 'animals', 'plants', and 'other'. Make the 'animals' key refer to another dictionary with the keys 'cats', 'octopi', and 'emus'. Make the 'cats' key refer to a list of strings with the values 'Henri', 'Grumpy', and 'Lucy'. Make all the other keys refer to empty dictionaries.
16. Print the top-level keys of life.
17. Print the keys for life['animals'].
18. Print the values for life['animals']['cats'].
19 Assign the value 7 to the variable guess_me. Then, write the conditional tests (if,else, and elif) to print the string 'too low' if guess_me is less than 7, 'too high' if greater than 7, and 'just right' if equal to 7.
20. Assign the value 7 to the variable guess_me and the value 1 to the variable start.
Write a while loop that compares start with guess_me. Print too low if start is less
than guess me. If start equals guess_me, print 'found it!' and exit the loop. If start
is greater than guess_me, print 'oops' and exit the loop. Increment start at the end of the loop.
21. Use a for loop to print the values of the list [3, 2, 1, 0].