Answered step by step
Verified Expert Solution
Question
1 Approved Answer
should be implemented in python and the code should give an output previous answer that i got.. the code was right but did not print
should be implemented in python and the code should give an output
previous answer that i got.. the code was right but did not print any result
Fyn ## Problem 1 (6 marks) {-} Create a Python class 'my_family, which will have the following attributes": _init my_first_name -> default set to 'John' by my_family_name => default set to 'Wick' by init my_fathers_name >> default set to "unknown by _init_ my_mothers_name -> default set to unknown by _init_ my_sisters_name -> default set to unknown' by - init_I my_brothers_name -> default set to "unknown' by _init_ the class should also contain the following methods 1. _init__(self, first_name = 'John', second_name = Wick') (1 marks) This function will assign: first_name to my_first_name second_name to my family name my_fathers_name, my_mothers_name, my sisters_name and my_brothers_name will all be set to the string "unknown 2. "return_my_name(self) (1 marks) the function will return a 'list' containing two elements in the following order my_first_name, my_family_name second_name to my_family_name - my_fathers_name, my mothers_name, my sisters_name and my_brothers_name will all be set to the string 'unknown Pyti 2. "return_my_name(self) (1 marks) the function will return a 'list' containing two elements in the following order my_first_name, my_family_name (1 marks) 3. odd_parents_names(self, mothers_first_name, fathers_first_name) - assign mothers_first_name to my_mothers_name assign fathers_first_name to my_fathers_name add_siblings_names(self, sisters_first_name, brothets_first_name) - assign sisters_first_name to my sisters_name brothers_first_name to my_brothers_name 4. (1 marks) 5. 'return_all_first_names(self) (1 marks) - this function will return a dictionary as follows: {'me':my_first_name, 'my_mum': my_mothers_name, 'my_dad': my_fathers_name, 'my sister zmy_sisters_name, 'my_brother':my_brothers_name} 6. 'check_if_my_sisters_name(self, name) (1 marks) test whether name is equal to my_sisters_name if yes return True if not return falseStep 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