Python: String: Count Upper

Write the function count_upper that take a string and two integers lo and hi, and returns the number of uppercase letters from position lo to position hi inclusive.


count_upper('we all aGrEEd; it Was a magNifiCeNT Evening.', 2, 20) -> 4
count_upper('we all aGrEEd; it Was a magNifiCeNT Evening.', 2, 50) -> 9

Test 1    

Test 2    

Test 3    

Test 4    

Test 5    

Test 6