python-tutorial icon indicating copy to clipboard operation
python-tutorial copied to clipboard

Errors found in the `basic_datatypes` notebook

Open despadam opened this issue 1 year ago • 6 comments

  • [ ] Add import math in solution_circle_area() in basic_datatypes and explain that pi is defined there
  • [ ] It is not clear that quadratic equation expects two results
  • [ ] solution_number_is_lower_than_0_or_greater_than_100 in the test we check for >=
  • [ ] in comparison operators, explain the difference of == and isequal with the float number problem and how is it repsresented in bits

despadam avatar May 06 '24 09:05 despadam

in the def solution_number_is_even(number: float) -> bool: the input types do not match. It should be number:int

yakutovicha avatar May 06 '24 09:05 yakutovicha

https://docs.python.org/3/library/decimal.html

baffelli avatar May 06 '24 09:05 baffelli

In the exercise solution_return_first_and_last_element_from_list, the annotated return type is list[float] however the solution checks for a tuple[float, float]. We should make this consistent

baffelli avatar May 06 '24 09:05 baffelli

popitem does not remove an arbitrary element but the last element inserted into a dict.

baffelli avatar May 06 '24 11:05 baffelli

For the record: it takes roughly 3 hours to finish the basic datatypes section, so we might want to give students a bit more time for the next tutorial.

yakutovicha avatar May 06 '24 11:05 yakutovicha

From #233: In the basic datatypes notebook, trying to convert a complex number to float raises a TypeError as expected. However, it doesn't print the error to the console unless it is surrounded by a try...except statement.

despadam avatar May 08 '24 11:05 despadam