empa-scientific-it / python-tutorial

Material for a Jupyter-based Python tutorial
MIT License
31 stars 9 forks source link

Errors found in the `basic_datatypes` notebook #232

Open despadam opened 5 months ago

despadam commented 5 months ago
yakutovicha commented 5 months ago

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

baffelli commented 5 months ago

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

baffelli commented 5 months ago

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 commented 5 months ago

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

yakutovicha commented 5 months ago

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.

despadam commented 5 months ago

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.