B: Artwork label (modules) Ex: If the input is: Pablo Picasso 1881 1973 Three Musicians 1921 the output is: Artist: Pablo Picasso (1881 to 1973) Title: Three Musicians, 1921 Ex: If the input is: Brice Marden 1938 -1 Distant Muses 2000 the output is:
B: Artwork label (modules) Ex: If the input is: Pablo Picasso 1881 1973 Three Musicians 1921 the output is: Artist: Pablo Picasso (1881 to 1973) Title: Three Musicians, 1921 Ex: If the input is: Brice Marden 1938 -1 Distant Muses 2000 the output is:
B: Artwork label (modules) Ex: If the input is: Pablo Picasso 1881 1973 Three Musicians 1921 the output is: Artist: Pablo Picasso (1881 to 1973) Title: Three Musicians, 1921 Ex: If the input is: Brice Marden 1938 -1 Distant Muses 2000 the output is:
The current code that I have, is currently uploaded to make it easier. As I stated before the code is correct, it is just the spacing that I need help with to correct the spacing errors. Please attach a screen shot of the code, like I have done. It helps with spacing and less errors.
Please review the spacing errors as well.
Thank you for all of your help.
Transcribed Image Text:The image displays a comparison of code outputs for an art-related application and includes two sections where output discrepancies are highlighted.
**Section 2: Compare Output**
- **Input:**
- Artist: Brice Marden
- Year of Birth: 1938
- Year of Death: -1
- Title: Distant Muses
- Year of Title: 2000
- **Your Output:**
- Artist: Brice Marden, 1938
- Title: Distant Muses, 2000
- **Expected Output:**
- Artist: Brice Marden, 1938 – present
- Title: Distant Muses, 2000
The difference highlighted is in the representation of the artist's lifespan; the expected output includes "present" after the birth year since the artist is still alive.
**Section 3: Compare Output**
- **Input:**
- Artist: Banksy
- Year of Birth: -1
- Year of Death: -1
- Title: Balloon Girl
- Year of Title: 2002
- **Your Output:**
- Artist: Banksy, -1
- Title: Balloon Girl, 2002
- **Expected Output:**
- Artist: Banksy (unknown)
- Title: Balloon Girl, 2002
Here, the discrepancy is in the handling of the unknown birth and death years for Banksy. The expected output replaces "-1" with "(unknown)" to represent uncertainty about Banksy's birth and death years.
Both sections have an evaluation score of 0/1, indicating the output did not meet the expected requirements.
Transcribed Image Text:This code is written in Python and demonstrates the use of classes to model an "Artist" and their "Artwork". Below is a detailed description and transcription of the code:
### Code Overview
The code defines two classes: `Artist` and `Artwork`. Instances of these classes represent artists and their respective artworks, including relevant information such as names, birth and death years, artwork titles, and the year the artworks were created. The code allows for user input to populate these classes and prints out the information.
### Classes and Methods
1. **Class: `Artist`**
- **Method: `__init__`**
- Parameters: `self`, `name='None'`, `birth_year=0`, `death_year=0`
- Initializes an artist's name, birth year, and death year.
- **Method: `print_info`**
- Prints out the artist's name and birth/death years.
- If `death_year` is not provided (equals -1), it prints only the birth year.
- Otherwise, it prints the birth year followed by the death year.
2. **Class: `Artwork`**
- **Method: `__init__`**
- Parameters: `self`, `title='None'`, `year_created=0`, `artist=Artist()`
- Initializes the artwork’s title, year created, and associated artist.
- **Method: `print_info`**
- Calls the artist's `print_info` method.
- Prints the artwork's title and the year it was created.
### Main Functionality
- Takes user input to create an artist and an artwork.
- User inputs:
- Artist's name, birth year, death year.
- Artwork's title and year of creation.
- Constructs objects of the `Artist` and `Artwork` classes using the input data.
- Prints out the information using the `print_info` methods of both classes.
### Transcription of the Code
```python
class Artist:
def __init__(self, name='None', birth_year=0, death_year=0):
self.name = name
self.birth_year = birth_year
self.death_year = death_year
def print_info(self):
print('Artist: ' + self.name, end='')
if self.death_year == -1:
print(' (' + str(self.birth_year) + ')
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.