### Edit exercise 4 to remove some pain-points for students

parent 982ac8fa
 ... ... @@ -46,14 +46,18 @@ exercise.code = "weight = {} #TODO: Initialise weight with correct values\navai exercise.tests = [Test("Weight calculation", "Overall weight: 310\n")] exercise.checks = [Check("You should use a for loop to loop over all keys in one of the dictionaries", "for "), Check("You should calculate the value", "310", True), Check("You need to specify the correct weights in a dictionary", "[\"']pencil[\"']:(\\s)+10"), Check("You need to specify the correct weights in a dictionary", "[\"']pen[\"']:(\\s)+20"), Check("You need to specify the correct weights in a dictionary", "[\"']paper[\"']:(\\s)+4"), Check("You need to specify the correct weights in a dictionary", "[\"']eraser[\"']:(\\s)+80"), Check("You need to specify the correct availability in a dictionary", "[\"']pen[\"']:(\\s)+3"), Check("You need to specify the correct availability in a dictionary", "[\"']pencil[\"']:(\\s)+5"), Check("You need to specify the correct availability in a dictionary", "[\"']eraser[\"']:(\\s)+2"), Check("You need to specify the correct availability in a dictionary", "[\"']paper[\"']:(\\s)+10")] Check("For this exercise, you need to initialise the dicrionary when it is created", "\[[\"']pencil[\"']\](\\s)*=", True), Check("For this exercise, you need to initialise the dicrionary when it is created", "\[[\"']pen[\"']\](\\s)*=", True), Check("For this exercise, you need to initialise the dicrionary when it is created", "\[[\"']paper[\"']\](\\s)*=", True), Check("For this exercise, you need to initialise the dicrionary when it is created", "\[[\"']eraser[\"']\](\\s)*=", True), Check("You need to specify the correct weights in a dictionary", "[\"']pencil[\"'](\\s)*:(\\s)+10"), Check("You need to specify the correct weights in a dictionary", "[\"']pen[\"'](\\s)*:(\\s)+20"), Check("You need to specify the correct weights in a dictionary", "[\"']paper[\"'](\\s)*:(\\s)+4"), Check("You need to specify the correct weights in a dictionary", "[\"']eraser[\"'](\\s)*:(\\s)+80"), Check("You need to specify the correct availability in a dictionary", "[\"']pen[\"'](\\s)*:(\\s)+3"), Check("You need to specify the correct availability in a dictionary", "[\"']pencil[\"'](\\s)*:(\\s)+5"), Check("You need to specify the correct availability in a dictionary", "[\"']eraser[\"'](\\s)*:(\\s)+2"), Check("You need to specify the correct availability in a dictionary", "[\"']paper[\"'](\\s)*:(\\s)+10")] exercises.append(exercise) # Exercise 5 ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!