Traceback (most recent call last): File "main.py", line 11, in user_artist = Artist(user_artist_name, user_birth_year, user_death_year) TypeError: 'module' object is not callable I know it's something simple but I can't quite find my error.  Can I get some direction on where to look for it?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Define the Artist class in Artist.py with a constructor to initialize an artist's information. The constructor should by default initialize the artist's name to "None" and the years of birth and death to 0.

Define the Artwork class in Artwork.py with a constructor to initialize an artwork's information. 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. Add an import statement to import the Artist class.

Add import statements to main.py to import the Artist and Artwork classes.

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

Main.py code:

# TODO: Import Artist from Artist.py and Artwork from Artwork.py
import Artist
import Artwork
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()

 

 

Traceback (most recent call last): File "main.py", line 11, in <module> user_artist = Artist(user_artist_name, user_birth_year, user_death_year) TypeError: 'module' object is not callable

I know it's something simple but I can't quite find my error.  Can I get some direction on where to look for it?

Current file: Artist.py
1 class Artist:
2
name = "None"
year_of_birth = 0
year_of death = 0
4
_init_(self, artist_name, artist_year_of_birth, artist_year_of_death):
self.name = artist_name
self.year_of_birth = artist_year_o
self.year_of_death = artist_year_of_death
6
def
7
8
9
10
11
def print_info(self):
if self.death_year
print('Artist: {}, born {}'. format(self.name, self.birth_year))
12
13
-1:
==
14
15
else:
16
print('Artist: {} ({}-{})'.format(self.name, self.birth_year, self.death_year))
Transcribed Image Text:Current file: Artist.py 1 class Artist: 2 name = "None" year_of_birth = 0 year_of death = 0 4 _init_(self, artist_name, artist_year_of_birth, artist_year_of_death): self.name = artist_name self.year_of_birth = artist_year_o self.year_of_death = artist_year_of_death 6 def 7 8 9 10 11 def print_info(self): if self.death_year print('Artist: {}, born {}'. format(self.name, self.birth_year)) 12 13 -1: == 14 15 else: 16 print('Artist: {} ({}-{})'.format(self.name, self.birth_year, self.death_year))
Current file: Artwork.py
1
# TODO: Import Artist from Artist.py
2
3 class Artwork:
4
title = "None"
year_of_creation = 0
def
init_(self, artwork_title, artwork_year_of_creation):
self.title
6
7
artwork_title
self.year_of_creation=Dartwork_year_of_creation
def print_info(self):
self.artist.print_info()
print('Title: %s, %d' % (self.title, self.year_created))
8
9
10
11
Transcribed Image Text:Current file: Artwork.py 1 # TODO: Import Artist from Artist.py 2 3 class Artwork: 4 title = "None" year_of_creation = 0 def init_(self, artwork_title, artwork_year_of_creation): self.title 6 7 artwork_title self.year_of_creation=Dartwork_year_of_creation def print_info(self): self.artist.print_info() print('Title: %s, %d' % (self.title, self.year_created)) 8 9 10 11
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY