42948/count-words-in-a-string-in-python
You have to use the count method to do this:
statement="how many have I use how many and how" x=statement.count("how") print (x)
To count the number of appearances: from collections ...READ MORE
for c in "string": ...READ MORE
You can use word.find('o') as well to ...READ MORE
class Solution: def firstAlphabet(self, s): self.s=s k='' k=k+s[0] for i in range(len(s)): if ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Python strings are immutable, you change them ...READ MORE
n=[1,2,3,4,5,6,7,8,9] print(len(n)) =9 READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.