worldbank / dec-python-course

14 stars 5 forks source link

session-1 feedback #14

Closed kbjarkefur closed 1 year ago

kbjarkefur commented 2 years ago

Feedback on session Aug 22, 2022

weilu commented 2 years ago
y = int(7.25)
print(y, type(y))

Note: type parsing from float to int drops everything after decimal point

luisesanmartin commented 2 years ago
y = int(7.25)
print(y, type(y))

Note: type parsing from float to int drops everything after decimal point

Related to this, using a number with a decimal part higher or equal than .5 would be a good way to show that int() drops the decimal part as opposed to rounding a decimal number

weilu commented 2 years ago

String section: add string interpolation / f-string. Consider replacing str.format with f-string

weilu commented 2 years ago

Should the concept of a function/method covered before one is used e.g. str.upper?

weilu commented 2 years ago

Potentially useful to add: To see all available functions on strings, you can type dir(str) or dir(""). Then for each of the function to bring up the documentation/help, type the method name followed by ? e.g. str.capitalize?

weilu commented 2 years ago

Exercise 6 a and b may need revision as they can be hacked by putting in a and b

luisesanmartin commented 2 years ago

we might want to add something related to help() or using the ? character after a function to check function/methods documentation

luisesanmartin commented 2 years ago

nested list examples: second index needs to be changed to 2

# Access item in nested lists "f"
f = nested_list[2][0]
weilu commented 2 years ago

Exercise 8 needs more time than 8 minutes

weilu commented 2 years ago

Exercise 9 needs more than 4 minutes

kbjarkefur commented 2 years ago

Nested list index bug fixed in : 6d791a7107c977026e19fa254b08631b24bdbf35

kbjarkefur commented 2 years ago

dict functions to add: