Python 6.6 : Exercise : Conditions
We are going to continue our learning here we are going to make an exercise on the conditions, the exercise is going to compare the number of points to the number of questions if the number of points is equal to the number of questions ... you send back to the user excellent, if the number of points equals 0 you send back you have to revise your mathematics and then you have to calculate the ... average, which is equal to the number of questions divided by 2, if for example the number of questions is 5 we ... If the number of questions is 5, for example, we will have 2 points and you have to return an int which means that you have to convert the average into an int because 2.5 is a float value and after calculating the average, if the number of points is higher than the average you have to write not bad, if the number of points is lower than the average you have to write can do better so I let you do the exercise and we will meet again in a few minutes for the correction. Well, concerning the correction, we will compare here by doing an if if number of points equal to the number of questions two points print excellent elif if the number of points equal to 0 two points print you have to revise your math And it's up we will have to calculate the average by doing average equals int parenthesis Number of questions divided by 2 and we will continue elif number of points is greater than average two points print not bad else print can do better good I'll run my code you see excellent I raise I miss the rest, 4 can do better, 1 out of 5 I raise I'll make the effort to find two, 11,10 can do better 2 out of 5 good now if I put 0, 0 0, 0 you have to revise your mathematics and the last point is I make the effort to find 4 not bad. So that was all for this exercise, we'll see you soon for the next one concerning addition or multiplication.