-
Notifications
You must be signed in to change notification settings - Fork 253
Today's Mood
Sar Champagne Bielert edited this page Apr 5, 2024
·
14 revisions
Understand what the interviewer is asking for by using test cases and questions about the problem.
- Should the function always print the same mood?
- Yes.
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Make a function that prints an emoji representing today's mood.
1) Create a new function by writing a function signature
2) Create a variable to store the current mood emoji
3) Print "Today's mood:" followed by the value of the variable
3) Call the created function
- Emojis are considered characters by python, and thus need to be put in quote-marks, like strings.
def todays_mood():
mood = "🥱"
print("Today's mood: " + mood)
todays_mood()