Skip to content

Today's Mood

Sar Champagne Bielert edited this page Apr 5, 2024 · 14 revisions

Unit 1 Session A

U-nderstand

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.

P-lan

Plan the solution with appropriate visualizations and pseudocode.

General Idea: Put the lines of code in order to write and call a function that prints a message.

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

⚠️ Common Mistakes

  • Emojis are considered characters by python, and thus need to be put in quote-marks, like strings.

I-mplement

def todays_mood():
	mood = "🥱" 
	print("Today's mood: " + mood)

todays_mood()
Clone this wiki locally