3. if

Activity: CodeLens 3.1 (cl_l10_3a_en)

3.1. Two points and indentation

  • Note that in Python it is mandatory to complete any condition (if) with :.

  • Also remember to indent the code blocks inside the conditions, it is mandatory.

Check if a car is new or old: + If the car is at least three years old, it’s new, it is old otherwise.

Activity: CodeLens 3.1.1 (cl_l10_3b_en)

  • Ask the speed of a car, assuming it is an integer.

  • In case the speed exceeds 110 km/h, display a message saying that the user has been fined.

  • Show the amount of the fine if you are fined, charging $5.00 for each km above the 110 km/h.

Activity: CodeLens 3.1.2 (cl_l10_3c_en)

You have attempted of activities on this page