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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!