Loading…
Write a function that raises ValueError if its argument is negative. Call it with -5 and catch the exception, printing 'Invalid input.'.
Create a free account to save your progress and reveal the worked answer for this free exercise. The complete practice library is available with Practice Pass or Mastery.
Create a free account to save your progress and reveal the worked answer for this free exercise. The complete practice library is available with Practice Pass or Mastery.