Question: how can I write numbers = 0 evenCount = 0 oddCount = 0 def CheckEvenOdd(num): global evenCount, oddCount if num % 2 == 0: evenCount
how can I write numbers = 0 evenCount = 0 oddCount = 0 def CheckEvenOdd(num): global evenCount, oddCount if num % 2 == 0: evenCount += 1 print("This number is even") else: oddCount += 1 print("This number is odd") for a in range(5): num = int(input("Enter a number: ")) CheckEvenOdd(num) without using the global variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
