This code finds a single letter and checks if its in the word thats inputted. How can I have the letter I am searching for as a PARAMETER?

前端 未结 0 937
清酒与你
清酒与你 2021-01-05 01:38
def count_letter(letter):
    a = input("whats the word: ")
    count = 0

    for i in a:
       if i == letter:
        count += 1
    return count


pri         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题