

I want to find the c character here by using count function from the memory location 4 to 11 by using count function .my assumption the answer would be 2. but the answer returning 1.why ? Thanks in advance.


I want to find the c character here by using count function from the memory location 4 to 11 by using count function .my assumption the answer would be 2. but the answer returning 1.why ? Thanks in advance.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitin SontakkePosted Feb 3, 2023, 5:28 PM
While not completely satisfied, I just learned from my son that in from - to range in Python, the from is always inclusive and to is always exclusive. Strange!
That explans the answer, however, as if you make it 12 answer becomes 2.
Hope that helps!