Question: Step 1 : Producing correct output Three commented - out lines of code exist in the main part of the program. Uncomment the lines and
Step : Producing correct
output
Three commentedout lines of code exist in the main part of the program. Uncomment the lines and click the "Run program" button.
Verify that the program's output is:
Unknown method: printplus
Secret string: "abc"
Submit your code for grading. Your submission will pass the "Compare output" test only, achieving of the possible points.
Step : Inspecting the LabPrinter class
Inspect the LabPrinter class implemented in the
LabPrinter.py file. Access
LabPrinter.py by clicking on the orange arrow next to
IntroToDSELabs.py at the top of the coding window. Instance methods printplus and printsecret print strings
using print
Step : Implementing callmethodnamed
Remove the three uncommented lines from the main part of the program. Then implement the callmethodnamed function in
IntroToDSELabs.py to handle three cases:
If methodname is "printplus call printer's printplus instance method.
If methodname is "printsecret", call printer's printsecret instance method.
If methodname is anything other than the two strings mentioned above, print "Unknown method: xyz where is
methodname's value.
After implementing callmethodnamed click the "Run program" button. Verify that the program's output is once again:
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
