CodingBat - count_code (Python)

preview_player
Показать описание
This is a video solution to the count_code problem in Strings 2 (Python) from codingbat.
Рекомендации по теме
Комментарии
Автор

Very nice video, please do more of these tutorials, they are helping me so much in my python learning journey
I really like how you break up the problem and explain in simple and short way
very unique and helpful.
Thank you

khaledalshammari
Автор

Thanks, Paul! I was confused about the str[i+3] part of the solutions posted elsewhere online and couldn't find a specific explanation for it. Your video was exactly what I needed, and I'll be coming back next time I need help with CodingBat.

teriburrito
Автор

condition - if str[i:i+2] == "co" and str[i+3]=="e":

samxsharan
Автор

Why do you choose [0:4] and [6:10] as your reading frame size?

maxhsu
Автор

First of all, Thank you for the tutorial! I couldn't figure this one out and was afraid to post a question on StackExchange because people get mad at beginners' questions. So it was relief to find your video. I do have questions related to the line "for i in range(0, len(str)-3, 1):" What is the "1" for? I learned from the previous (cat_dog) exercise to use "for i in range(len(str)-1)", so I was surprised to see "-3" in your video. I suspect the "1" refers to the letter "e" (in "code"), but if it's the last letter, shouldn't it be "[-1]"?

yumeileventhal
Автор

hi Paul, your video helped me a lot thanks, but why did we ignored the third character which can be any latter after co?

abduljelilali
Автор

Hello, I'm still confused as to why you're using length of the string and subtracting one less from the reading frame making it minus 3. Could you explain it to me?

MultiDman
Автор

Can this problem be solved in one line?

lepa
Автор

if 'co' = [i:i + 2] why doesn't 'e' = [i:i + 4]??

johnkelly
Автор

first dislike
yes
but tutorial was good so i changed it to a like

satvikvarmasrivatasavai
Автор

Sir why u have taken range(0, len(str)-3, 1)??

sindhusiva
join shbcf.ru