Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 6 (1 point) The function EvenCount counts the number of even integers in a list of integers. Incomplete code for this function is as
Question 6 (1 point) The function EvenCount counts the number of even integers in a list of integers. Incomplete code for this function is as follows: def EvenCount(L): count = 0 for x in L: #FIX ME# #FIX ME# return count What should the two lines of code which contain the expression #FIX ME# be replaced with in order to complete the code? if x % 2 == 0: count += 1 if x % 2 != 0 count = 1 if x % 2 == 0: count = 1 if x % 2 != 0 count + 1 Question 10 (1 point) The function Successor replaces each element of a list of integers with one added to that element. For example, when this function receives (2,0,-3) as input, the output will be (3,1,-2). Incomplete code for Successor is given below. def Successor(A): for i in range(0, len(A)): #FIX ME# return A What should the line of code which contains the expression #FIX ME# be replaced with in order to complete the code? i = 1 + A[i] A[i] = 1 + A[i] i = 1 + i A[i] = 1 +
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started