Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Input values status 1 , location 1 and username 1 are read from input, representing the status, location, and username of a profile. An element
Input values status location and username are read from input, representing the status, location, and username of a profile.
An element representing a new status is also read from input as newstatus. Complete the following tasks:
Assign profile with an instance of Profile with status location and username as attributes in that order.
Call profiles printdata
Call profiles updatestatus with argument newstatus.
Call profiles printdata again.
Click here for example
Ex: If the input is:
active
Oregon
tanvulture
busy
then the output is:
Profile data: active, located in Oregon, user tanvulture
Profile data: busy, located in Oregon, user tanvulture
class Profile:
def self status, location, username:
self.status status
self.location location
self.username username
def updatestatusself newstatus:
self.status newstatus
def printdataself:
printfProfile data: selfstatus located in selflocation user selfusername
status input
location input
username input
now ctatlic innutr
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started