Random Computer Science - Computational Thinking And Programming 2 Practice
20 randomly selected questions from Computational Thinking And Programming 2 topics
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)
Random Practice Session
Community Stats
Track Your Random Practice
Sign up to save your random practice progress and compare your performance across different categorys.