You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the start of Ch5 "You must import a library or module before using it"
Use import to load a library into a program’s memory. Then you can refer to things from the library as library_name.function
Then the first thing you load in is string.ascii_lowercase which is not a function, it is a string!
Suggestion on how to resolve it:
Edit the text above so it is more general: "Then you can refer to things from the library as library_name.object"
Then have the code box be something like:
import string
# Using an imported function
print(string.capwords('capitalise this sentence please.'))
# Imported objects can also be strings, numbers, or other types of objects
print(f'The lower ascii letters are {string.ascii_lowercase}')
Which part of the content does your suggestion apply to?
Ch5 You must import a library or module before using it
Activity