class School:
"""Represents a school."""
What is the name of the defined class in the script above?
Create a class, any instance of it, save them to variables, and assign any attribute to this instance.
Create two classes, Library and Book.
Create a library, library and add some books to library.books dictionary
whose keys are characters and values are list of books whose title start with that character.
Example:
{'a': [<Book whose title is 'Ali baba'>, ...], 'o': [<Book whose title is 'Of Mice and Men'>, ...]}
Add a new book that starts with 's'.
Print the first book that starts with 's'.
Create two classes, Book and Author.
Create an author, writer, with name and age attributes
Create a book, novel, with title: str, pages: int and author: Author attributes.
class Horse:
pass
h = Horse()
h.name = "Storm"
h.age = 5
h.color = "Brown"
h.color = "Black"
h.age += 2
What is the value of the following expressions at the end of execution of the above script?
| h.color: | ||
| h.age: |
Create a class named Dog
Create a dog, dog, with two attributes, name and age.
Change dog's name
Add one year to dog
Create a class named Book
Create an instance of Book and assign it to book
Assign two attributes to book, title and pages, with values "Of Mice And Men" and 120 respectively.
Create two classes, Recipe and Ingredient.
Create some ingredients with one attribute, name.
Create a recipe and add created ingredients to its ingredients: tuple attribute.
Print the name of the first ingredient of the created recipe.
Create a class that represents city
Create an instance of it and assign it to c
Assign three attributes to it, name, population and is_capital, with values a string, an integer and a boolean respectively.
class Company:
"""Represents a company."""
What is the name of the defined class in the script above?