Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = "Hello Python!"
- print(s.count('o'))
- # output : 2
- print(s.count('h'))
- # output : 1
- # case sensitive: 'H' is not counted as an occurrence of 'h'
- print(s.count('Py'))
- # output : 1
- print(s.count('x'))
- # output : 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement