← Back to Question List
Python Code Walkthrough #23
Returning Early From A Loop
📄 Code
Read carefully — what does this print?1def first_negative(values: list[int]) -> int:2 for value in values:3 if value < 0:4 return value5 return 067print(first_negative([3, -2, -8]))8print(first_negative([1, 2]))9print(first_negative([-5]))