why did python return answer as 8 instead of 7 cos i'm told we start counting from 0 ,help i'm a noob | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

why did python return answer as 8 instead of 7 cos i'm told we start counting from 0 ,help i'm a noob

phrase="Giraffe Academy" print(phrase.index("A"))

14th Feb 2020, 1:29 PM
Alex Trice
Alex Trice - avatar
2 ответов
+ 3
0 G 1 i 2 r 3 a 4 f 5 f 6 e 7 " " (space) 8 A
14th Feb 2020, 1:34 PM
Gordon
Gordon - avatar
+ 3
okay we count space as well?? thanks a mil!!!
14th Feb 2020, 1:35 PM
Alex Trice
Alex Trice - avatar