This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def sumEvenNumbersInMatrix(matrix): | |
return sum(matrix[matrix%2==0]) | |
rows = 3 | |
columns = 3 | |
#Example input | |
# 1 2 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sumOdd(lowerLimit, upperlimit): | |
return sum(range(lowerLimit if lowerLimit%2 else lowerLimit+1,upperLimit,2)) | |
lowerLimit = int(input()) | |
upperLimit = int(input()) | |
print (sumOdd(lowerLimit,upperLimit)) |