Unit 5 Session 1 (Click for link to problem statements)
TIP102 Unit 5 Session 1 Standard (Click for link to problem statements)
Understand what the interviewer is asking for by using test cases and questions about the problem.
- Established a set (2-3) of test cases to verify their own solution later.
- Established a set (1-2) of edge cases to verify their solution handles complexities.
- Have fully understood the problem and have no clarifying questions.
- Have you verified any Time/Space Constraints for this problem?
kart
attribute of player_one
and verify the change using the get_player()
method.HAPPY CASE
Input: Update player_one's kart to "Dolphin Dasher"
Output: "Yoshi driving the Dolphin Dasher"
Explanation: The `kart` attribute of `player_one` is updated successfully, and this change is reflected in the output.
EDGE CASE
Input: Update kart to an empty string
Output: "Yoshi driving the "
Explanation: The kart is updated to an empty string, and the output reflects this.
Match what this problem looks like to known categories of problems, e.g. Linked List or Dynamic Programming, and strategies or patterns in those categories.
For class attribute update problems, we want to consider the following approaches:
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Update the kart
attribute of player_one
and use the get_player()
method to confirm the update.
1) Access `player_one.kart` using dot notation.
2) Assign the new value "Dolphin Dasher" to `player_one.kart`.
3) Use the `get_player()` method to verify that the kart has been updated.
⚠️ Common Mistakes
get_player()
method.Implement the code to solve the algorithm.
player_one.kart = "Dolphin Dasher"
print(player_one.get_player()) # Output: "Yoshi driving the Dolphin Dasher"
Review the code by running specific example(s) and recording values (watchlist) of your code's variables along the way.
Evaluate the performance of your algorithm and state any strong/weak or future potential work.