EXTENDED VERSION OF THE COURSE WITH ASSIGNMENT CHECKING - https://stepik.org/103831
In this video, you'll learn about the count method, which counts the number of occurrences of one string within another. The simplest form of the call, s.count(t), returns the number of occurrences of string t within string s. Only non-overlapping occurrences are counted, for example:
When specifying three parameters, s.count(t, a, b), the number of occurrences of string t in the slice s[a:b] will be counted.
00:00 - The count method
00:57 - Non-overlapping occurrences
01:55 - The count method with 3 parameters
02:06 - The "Word Count" problem
Python from Scratch is a course designed for beginner programmers with no programming experience. In it, we start from scratch and cover all topics in detail with problem-solving examples.
This course covers the fundamentals of programming, where you'll learn the main operators and logical structures. It will allow you to easily enter the world of programming.
Word Count Problem
You're given a string consisting of words separated by spaces. Determine how many words it contains. Use the count method to solve the problem.