You are given a one-dimensional array A (n), N = 10. calculate the sum of positive odd elements

You are given a one-dimensional array A (n), N = 10. calculate the sum of positive odd elements of a one-dimensional array.

(The solution to the problem is provided in the programming language – Python 3.6.4).

Let’s create an empty array a, which will be sequentially filled with n (10) elements entered by the user from the keyboard.

Using the for loop, we iterate over all the elements of the array, and thanks to the if condition, we find among them positive elements with odd values, then we find the sum of such elements. As a result, we get the following program:

a = []
n = 10
c = 0
for i in range (0, n):
b = int (input ())
a.append (b)
for i in range (0, n):
if a [i]% 2! = 0 and a [i]> 0:
c + = a [i]
print (c)



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.