forked from codepath/compsci_guides
-
Notifications
You must be signed in to change notification settings - Fork 0
Hundred Acre Wood
Jessica Sang edited this page Sep 14, 2024
·
1 revision
TIP102 Unit 1 Session 1 Standard (Click for link to problem statements)
- 💡 Difficulty: Easy
- ⏰ Time to complete: 2 mins
- 🛠️ Topics: Functions
Understand what the interviewer is asking for by using test cases and questions about the problem.
- Q: What is the function supposed to do?
- A: The function
welcome()
is supposed to print the string"Welcome to The Hundred Acre Wood!"
.
- A: The function
- Q: Are there any input parameters?
- A: No, the function does not take any input parameters.
- Q: What should the function return?
- A: The function does not return anything; it simply prints a string.
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Write a function that prints a predefined string.
1) Define the function `welcome()`.
2) Inside the function, use the `print` statement to output the desired string.
**⚠️ Common Mistakes**
- Forgetting to include the exact string format specified in the problem.
- Adding extra spaces or characters in the string.
Implement the code to solve the algorithm.
def welcome():
print("Welcome to The Hundred Acre Wood!")