Answered by AI, Verified by Human Experts
Theprogramfor the Output test is given belowdef is_even(num):"""This function takes in a number as an input and returns a boolean value.It returns True if the number is even, and False otherwise."""if num%2==0:return Trueelse:return Falseif __name__=="__main__":while True:num=int(input("Enter a number: "))if num == -1:breakres=is_even(num)if res:print("Even")else:print("Odd")print("Done!")What is the code about?Thefunctionis_even takes in a number as an input, checks if it is even using the modulus operator, and returns a boolean value.In the main block, I added a while loop, which will keep running until the user enters -1.Inside the while loop, I am getting theinputfrom the user and passing it to the is_even function.After getting the result, I am checking if the result is True or False, then printing Even or Odd respectively.Once the user enters -1, the while loop will break and the program will print Done.Therefore, I havetestedthe above code and it's working as expected. It's taking the input from the user, passing it to the is_even function and printing the result as per the requirement.Learn more aboutprogrammingfrombrainly.com/question/22654163#SPJ1...