50.5k views
3 votes
Write pseudocode (human-readable approximation of code) for a function that you might use in your daily life.

For example:

def find_keys (rooms_in_house):
for each room in the house:
search room
if keys are found, return which room it is.
if keys are not found in any room, return the String "Lost forever"

User The Sammie
by
7.5k points

1 Answer

3 votes

Answer:

Here's a pseudocode for a function that checks if it's raining outside before you leave your home:

function check_weather():

weather = get_current_weather() // API call to get weather information

if weather == "rainy":

print("It's raining outside. Bring an umbrella!")

else:

print("It's not raining outside. Have a nice day!")

User Rickharrison
by
7.9k points