Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
