1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
allochka39001 [22]
3 years ago
9

Define the Artist class with a constructor to initialize an artist's information and a print_info() method. The constructor shou

ld 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 XXXX if the year of death is -1 or Artist Name (XXXX-YYYY) 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()
Computers and Technology
1 answer:
nika2105 [10]3 years ago
8 0

Answer:

class Artist():

   def __init__(self, artist_name=None, artist_birth_year=0, artist_death_year=0):

       self.artist_name = artist_name

       self.artist_birth_year = artist_birth_year

       self.artist_death_year = artist_death_year

   def display_artist(self):

       if self.artist_death_year == -1:

           print('{}, born {}'.format(self.artist_name, self.artist_birth_year))

       else:

           print('{} ({}-{})'.format(self.artist_name, self.artist_birth_year, self.artist_death_year))

class Artwork():

   def __init__(self, artwork_title=None, artwork_year_created=0, artist=Artist()):

       self.artwork_title = artwork_title

       self.artwork_year_created = artwork_year_created

       self.artist = artist

   def display_artist(self):

       print('artwork_title: {}'.format(self.artwork_title))

       print('Artist: ', end='')

       self.artist.display_artist()

def main():

   user_artist_name = input('Enter the name of artist: ')

   user_birth_year = int(input('Enter birth year: '))

   user_death_year = int(input('Enter death year: '))

   user_title = input('Enter master piece title: ')

   user_year_created = int(input('Enter year created: '))

   user_artist = Artist(user_artist_name, user_birth_year, user_death_year)

   new_artwork = Artwork(user_title, user_year_created, user_artist)

   new_artwork.display_artist()

if __name__ == "__main__":

   main()

Explanation:  

  • Inside the constructor of Artist class, initialize the essential properties.
  • Create the display_artist function that checks whether artist_death_year is equal to -1 and then displays an appropriate message according to the condition.
  • Apply the similar steps as above for the Artwork class.
  • Inside the main method, get the information from user and finally call the display_artist function to print the results on screen.
You might be interested in
Which machine will work best to dig a hole in the soil?
sertanlavr [38]
I think the correct answer from the choices listed above is option A. The machine that will work <span>best to dig a hole in the soil would be a screw. The other two choices are not really used to dig a hole in the soil. Hope this answers the question. Have a nice day.</span>
8 0
3 years ago
When a policy setting in Computer Configuration and User Configuration in the same GPO conflict, the Computer Configuration poli
Maru [420]

Answer:

True

Explanation:

Computer Configuration policy applied first. This happens when the Computer system boots up. Then the user policy is applied when the user logs on. This takes place when the user object is in the same organizational unit.

So Computer Config policy setting takes precedence. User configurations is applied to local users only while computer configuration is applied to the machine itself. First the Computer GPO is applied and then the User GPO.  Loopback processing in replace mode enforces the Computer GPO over the user GPO.

8 0
4 years ago
Technology
Mashcka [7]

Answer

✔ user interface

✔ rendering engine

✔ browser engine

✔ Networking

✔ Data storage

:)

4 0
2 years ago
In the admin console, which three of these gmail settings can an administrator set for the entire domain? (choose 3)
ehidna [41]
<span>In the admin console, three settings than an admin can set for the entire domain in gmail are to enable users to set their own themes in gmail, allow users to delegate their mail out to other users, and enable users to have the ability to import their email from other platforms like yahoo, web mail, or hot mail.</span>
5 0
4 years ago
A two part circular linked chain implementation of a queue
dem82 [27]

Answer:A) All other answers

Explanation:

Circular linked chain is the type of the linked list formed that has the first component attached to the last component and every other are connected consecutively .

The circular linked list which is in two section is implemented in the form queue by the methods such as the initializing the nodes and using them when there is the requirement of it or it can also keep the node for the future use.

6 0
4 years ago
Other questions:
  • Q3** Write a query to create a new price list for books written by the same author. Allow the user to enter only the first 4 let
    15·1 answer
  • create a 3 to 5 step plan for checking out a post on social media for the next time you encounter something questionable.
    11·2 answers
  • what is the goal of technology A. to understand how the natural world functions B. to study the natural world C. to improve the
    9·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • 3. By default, Blender® remembers your last 32 actions and allows you to undo them one at a time by pressing CTRL+Z. (1 point)
    9·1 answer
  • When a third variable is included in an analysis and that third variable changes the relationship between the independent variab
    13·1 answer
  • A company accidentally sends a newsletter with a mistyped website address. The address points to a website that has been spoofed
    8·1 answer
  • Employee names are stored using a maximum of 50 characters. This information is an example of which of the following?
    9·1 answer
  • Define application software​
    12·1 answer
  • Add definitions for the following keywords to your glossary of words.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!