Using Modules
Libraries that you will use provide creating objects of new types with new properties, methods, attributes. Each library has specific documentation with explanations on methods/attrbites/classes provided. Let's remind what methods and objects are.
A method is a function that 'belongs to' an object.
An object is simply a collection of data (variables) and methods (functions) that act on those data.
Some libraries may also export constants - values that don't change during a program's execution. For example,
12345678910# Importing library from datetime import date # Create new 'date' object d = date(2022, 10, 10) # Applying method to object print(d.isoformat()) # Object attribute print(d.month) # Library constant print(datetime.UTC)
Tack för dina kommentarer!
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Awesome!
Completion rate improved to 2.7
Using Modules
Svep för att visa menyn
Libraries that you will use provide creating objects of new types with new properties, methods, attributes. Each library has specific documentation with explanations on methods/attrbites/classes provided. Let's remind what methods and objects are.
A method is a function that 'belongs to' an object.
An object is simply a collection of data (variables) and methods (functions) that act on those data.
Some libraries may also export constants - values that don't change during a program's execution. For example,
12345678910# Importing library from datetime import date # Create new 'date' object d = date(2022, 10, 10) # Applying method to object print(d.isoformat()) # Object attribute print(d.month) # Library constant print(datetime.UTC)
Tack för dina kommentarer!