fork download
  1. # Define the string
  2. string = 'Python Bash Java Python PHP PERL'
  3. # Define the search string
  4. search = 'Python'
  5. # Store the count value
  6. count = string.count(search)
  7. # Print the formatted output
  8. print("%s appears %d times" % (search, count))
Success #stdin #stdout 0.02s 7208KB
stdin
Standard input is empty
stdout
Python appears 2 times