0

why this is not working? can anyone please tell me where i am making mistak This is not giving any output

def count(word,x): count =0 for i in word: if i == x: count += 1 return count count('tarunyadav','a')

20th Apr 2022, 6:36 AM
Tarun
2 Answers
+ 1
You need to print the value that was returned by count() function print( count( 'tarunyadav', 'a' ) )
20th Apr 2022, 6:56 AM
Ipang
+ 1
thankyou
20th Apr 2022, 6:59 AM
Tarun