Closed kbjarkefur closed 1 year ago
y = int(7.25)
print(y, type(y))
Note: type parsing from float to int drops everything after decimal point
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
String section: add string interpolation / f-string. Consider replacing str.format
with f-string
Should the concept of a function/method covered before one is used e.g. str.upper
?
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?
Exercise 6 a and b may need revision as they can be hacked by putting in a
and b
we might want to add something related to help()
or using the ?
character after a function to check function/methods documentation
nested list examples: second index needs to be changed to 2
# Access item in nested lists "f"
f = nested_list[2][0]
Exercise 8 needs more time than 8 minutes
Exercise 9 needs more than 4 minutes
Nested list index bug fixed in : 6d791a7107c977026e19fa254b08631b24bdbf35
dict functions to add:
.values()
, .keys()
, .items()
Feedback on session Aug 22, 2022