Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the following class, what does _ _ str _ _ do ? class Employee: def _ _ init _ _ ( self , name,

In the following class, what does __str__ do?
class Employee:
def __init__(self, name, salary=0):
self.name = name
self.salary = salary
def give_raise(self, percent):
self.salary = self.salary +(self.salary*percent)
def work(self):
print(self.name + "does stuff")
def __str__(self):
return "Employee {}".format(self.name)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions