Question: python.. Write a class definition Stg which will model a string whose characters can be modified. When initialized it takes no inputs and if printed,
python.. Write a class definition Stg which will model a string whose characters can be modified. When initialized it takes no inputs and if printed, it would just be the empty string It has the following methods: add: Takes one string input (which you can assume is a single character); after this method is called, printing the object should print the same string with that character added at the end. change: takes two inputs- a string (single caharacter), and a number, and changes the character at the given index to the given character. get: takes one integer input and returns the the character at that position,and returns "Out of bounds" if not in bounds.
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
