generate functionTue, 21 Mar 2023

Write a program that finds the record number of occurrences (not necessarily consecutive) of a character in a string.

def occurs(s, c): return s.count(c) occurs('hello', 'l')

Questions about programming?Chat with your personal AI assistant