Quiz 4 Feedback
Here are some general statistics and feedback for your Quiz 4:
The average score was 8.10 out of 20. One big problem is that more than half of the programs could not be compiled.
The average score for Question 1 was 3.23 out of 10. The median was: 2 out of 10. For Question 2, the average was 4.75/10, median 4/10.
Common Mistakes
Many people wrote illogical code, making it very difficult to give any partial credit at all. For example, we had something like this as an answer:
distance = abs(i-(i+1))
I really do not understand what the expected result (and the point) of this programming statement is supposed to be!
Other common mistakes:
- Confusing the index of an item in a list, with the item itself. For example, we had lots of people do:
for i in a:
ord(a[i+1])
- Read the question properly. Some people printed out 1 2 3 4 5 6 7... for the Fibonacci numbers! Some others hardcoded the first 10 Fibonacci numbers -- those kind of answers won't get you any points!
- Check your open and close brackets. This is one of the most common mistakes -- even when you are doing your exercises during lecture time. We've lost count of the number of times we've seen something like this:
a = eval(input("...")
- Retrieving from variables before assigning values to them -- if you use a variable on the right side of a equals sign, please make sure that you have previously given that variable a value by using it on the left side of a equals sign! For that matter, all variables should be given a value before you use them!
- Indexing out of range -- remember that the last item in a list, or the last character in a string, has index len()-1.
- Wrong indexes -- again, read the question properly to know what is required. For question 2, when the string is "hello", the pair of "l"s is supposed to be at indexes 3 and 4, not 2 and 3. That is, the first character of the string is defined to be character 1. Check your program output with the sample output -- that's why it's there!
That's it. We hope that by providing this feedback, it will help you to avoid making the same mistakes next time. Hope that this is useful.