1
strr = "string"
print(strr.count(""))
#output: 7

my only guess as a reason for that output is that the count("") function is counting the given string as strr[0] = ",strr[1] = s, strr[2] = t, strr[3] = r, strr[4] = i, strr[5] = n, strr[6] = g, strr[7] = " but that's a weird way to count am I correct or is there some other reason why the output is 7? usually, I would expect the output to be 6 thanks for your answer in advance!

Sahas
  • 259
  • 2
  • 12
  • 2
    I don't think is a repeat question. I've looked for the answer but I couldn't find one – Sahas Sep 23 '18 at 19:47
  • 1
    The other question (and its answers) are reachable by clicking the link at the beginning of the question: https://stackoverflow.com/questions/50235859/why-does-test-count-return-5 – user4815162342 Sep 24 '18 at 05:48
  • 2
    yes, I saw that later. Thx anyways ! – Sahas Sep 24 '18 at 07:07

0 Answers0