Question: Given the object oriented programming function as shown below, split the code into ( 1 ) module and ( 2 ) call program ( main
Given the object oriented programming function as shown below,
split the code into module and call program main program that call on the module show all the codes
code:
class NumberList:
def initself:
self.numbers
def insertnumberself number:
self.numbers.appendnumber
def searchnumberself x:
if x in self.numbers:
return self.numbers.indexx
else:
return
def main:
N intinputEnter the number of elements:
numlist NumberList
printEnter numbers:".formatN
for in rangeN:
num intinput
numlist.insertnumbernum
X intinputEnter the number to search:
index numlist.searchnumberX
if index :
print
else:
printIndex of is formatX index
if namemain:
main
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
