399,848 views
40 votes
40 votes
A start-up employs interns. The following details of interns are stored

• first_name

• last_name

• address

• mobile_number

• e_mail

Create a class called Intern, which stores the above details. Craft two functions: getdata() which asks the user to enter data, and putdata() to display the data.

User The Memebot
by
2.6k points

1 Answer

16 votes
16 votes

Answer: See below.

class Intern:

def __init__(self):

self.first_name = input("Enter first name: ")

self.last_name = input("Enter last name: ")

self.address = input("Enter address: ")

self.mobile_number = input("Enter mobile number: ")

self.e_mail = input("Enter e-mail: ")

def getdata(self):

print("First name: ", self.first_name)

print("Last name: ", self.last_name)

print("Address: ", self.address)

print("Mobile number: ", self.mobile_number)

print("E-mail: ", self.e_mail)

def putdata(self):

print("First name: ", self.first_name)

print("Last name: ", self.last_name)

print("Address: ", self.address)

print("Mobile number: ", self.mobile_number)

print("E-mail: ", self.e_mail)

Step-by-step explanation:

A start-up employs interns. The following details of interns are stored • first_name-example-1
User Carol Skelly
by
3.1k points