Unit 1 Session 1 (Click for link to problem statements)
Understand what the interviewer is asking for by using test cases and questions about the problem.
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Create a function that prints all negative numbers in the list.
1) Loop through each number in the list
2) If the current number is less than zero, print it out
def print_negatives(lst):
for number in lst:
if number < 0:
print(number)
print_negatives([1,-2, 4, 3, -5])
# Output:
# -2
# -5
print_negatives([1,2,3,4,5])
# No output