This quiz consisted of the next five exercises from the page of quiz # 5.
In problem number six I had to add and multiply the elements in a list. My programming teacher helped me do this by making me think first about the process, step by step, the program has to make in order to get the expected result.
When I finished, it looked like this:
And ran like this:
Problem number seven was about reversing a string. I learned how to do that by looking into these two pages:
http://stackoverflow.com/questions/931092/reverse-a-string-in-python
https://docs.python.org/2/whatsnew/2.3.html#extended-slices
This is how I did it:
And how it ran:
The following problem was about indicating if a word is a palindrome (like ‘radar’) or not. After doing problem seven, eight was easy:
Here is how it ran:
Problem nine was about indicating if a value was or not in a list, without using the operator in. Here is how I did it:
And how it ran:
And finally, problem number ten was about comparing two lists and indicating if they had an element in common. After doing problem nine, this one was simple enough:
Here is how it ran:
3 thoughts on “Quiz # 6”