Skip to content

Ch5 first import is confusing #191

Open

Description

@DrJonnyT

How could the content be improved?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions