Answers for "Python String count() example"

0

Python String count() example

# Python program to demonstrate the use of
# count() method without optional parameters 
  
# string in which occurrence will be checked
string = "Hello Welcome to Softhunt.net We Welcome you" 
  
# counts the number of times substring occurs in 
# the given string and returns an integer
print(string.count("Welcome"))
Posted by: Guest on April-10-2022

Python Answers by Framework

Browse Popular Code Answers by Language