#take user input
      String = input('Enter the string :')
      #take character input
      Character = input('Enter character for which you want to calculate frequency :')
      #initiaalize int variable to store frequency
      frequency = 0
      #use count function to count frequency of character
      frequency = String.count(Character)
      #count function is case sencetive 
      #so it print frequency of Character according to given Character
      print(str(frequency) + ' is the frequency of given character')
      
      Python language logo

      Calculate Frequency of a Characters in a String

      0

      0

      avatar
      drzyadav

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.