subject

Define the Artist class with a constructor to initialize an artist's information and a print_info() method. The constructor should by default initialize the artist's name to "None" and the years of birth and death to 0. print_info() should display Artist Name, born if the year of death is -1 or Artist Name (-) otherwise.

Define the Artwork class with a constructor to initialize an artwork's information and a print_info() method. The constructor should by default initialize the title to "None", the year created to 0, and the artist to use the Artist default constructor parameter values.

Ex: If the input is:

Pablo Picasso
1881
1973
Three Musicians
1921
the output is:

Artist: Pablo Picasso (1881-1973)
Title: Three Musicians, 1921
If the input is:

Brice Marden
1938
-1
Distant Muses
2000
the output is:

Artist: Brice Marden, born 1938
Title: Distant Muses, 2000
class Artist:
# TODO: Define constructor with parameters to initialize instance attributes
# (name, birth_year, death_year)

# TODO: Define print_info() method. If death_year is -1, only print birth_year

class Artwork:
# TODO: Define constructor with parameters to initialize instance attributes
# (title, year_created, artist)

# TODO: Define print_info() method

if __name__ == "__main__":
user_artist_name = input()
user_birth_year = int(input())
user_death_year = int(input())
user_title = input()
user_year_created = int(input())

user_artist = Artist(user_artist_name, user_birth_year, user_death_year)

new_artwork = Artwork(user_title, user_year_created, user_artist)

new_artwork. print_info()

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 24.06.2019 11:20
Colby works as a shipping clerk for a major package delivery service. some of his daily tasks include tracking shipments and entering orders. which aspect of the information technology cluster would he most likely be trained in? a.networkingb.databasesc.hardwared.software
Answers: 2
question
Computers and Technology, 25.06.2019 08:20
The internet backbone is a foundation network linked with
Answers: 1
question
Computers and Technology, 25.06.2019 08:40
Which of the following statements is incorrect in relation to processes: while, strictly speaking, at any instant of time, the cpu is running only one process, in the course of 1 second, it may work on several of them, giving the illusion of parallelism a process is just an instance of an executing program, including the current values of the program counter, registers, and variables processes can be created when an operating system is booted, created by the user, or a running process can create children processes there is a master process, which when started can last forever, and is not killable
Answers: 3
You know the right answer?
Define the Artist class with a constructor to initialize an artist's information and a print_info()...
Questions
question
Chemistry, 25.11.2021 07:20
question
Social Studies, 25.11.2021 07:20
Questions on the website: 13722359