Test Index

CBSE Class 12 Computer Science 2023 Paper Compartment Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 19 of 35
Marks: +1, -0
Ravi, a Python programmer, is working on a project in which he wants to write a function to count the number of even and odd values in the list. He has written the following code but his code is having errors. Rewrite the correct code and underline the corrections made.
define EOCOUNT(L):
even_no=odd_no=0
for i in range(0,len(L))
if L[i]%2=0:
even_no+=1
Else:
odd_no+=1
print(even_no, odd_no)
Advertisements
Go to Question: