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')

Want to kickstart your project?Use the new AI Studio to create your code