def input_values(new_list):
new_list = []
n = int(input('Enter number of values: '))
for i in range(n):
new_list.append(int(input('Enter values: ')))
def is_list_even(new_list):
for i in range(len(new_list)):
if new_list[i]%2!=0:
return False
return True
def is_list_odd(new_list):
for i in range(len(new_list)):
if new_list[i]%2==0:
return False
return True
num=input_values()
if is_list_even(num)==True:
print('all even')
elif is_list_odd(num)==True:
print('all odd')
else:
print('not even or odd')
Answer:
There is only one modification in the above loop i.e. while loop should be like this--
while (i != n)
{
sum+=arr[i]; // Line 1, In question segment it is line 2.
i++; // Line 2, In question segment it is line 1.
}
Output:
Now if the array input is 1,2,3,4,5 then the output is 15.
Explanation:
In the above question, all the line of the segment is right except the body of the loop because--
- The First line of the loop is increment statement which increments the value of "i" variable from 1 and the value of "i" variable will be 1 in the first iteration of the loop
- The second line starts to add the value from 1'st index position of the array. Hence the segment gives the wrong answer. It adds the arr[1] to arr[n-1].
- So I interchanged both lines of the while loop as shown in the answer part. I make the line 1 (In question segment) as line 2(In answer part) and line 2 (In question segment) as line 1 (In answer part).
Now It gives the correct output because it can add arr[0] to arr[n-1].
It help to melt the snow quicker. they salt eats away the snow.
Answer:
"Compliance audit
" seems to be the correct answer.
Explanation:
- A compliance or enforcement audit seems to be a systematic analysis of the conformity of such an agency to the reporting requirements and guidelines.
- In a compliance audit, independent auditors determine the extent and completeness of enforcement plans, security protocols, user authentication, including risk management framework.