

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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nitin SontakkeRank #264 · 9.6K reputationPosted Feb 3, 2023, 12:28 PM EST
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!