 letter frequency on python data structures | Sololearn: Learn to code for FREE!

+2

# letter frequency on python data structures

Guys please can you help me on the first project of python data structures im stuck please thank you on the letter frequency

+8

+4

+4

LETTER FREQUENCY word=input() letter=input() n=len(word) per=((word.count(letter)/n)*100) print(int(per))

+4

txt = input() lter = input() co = 0 for i in txt: if i == lter: co +=1 print(int(co/len(txt)*100))

+3

Thank you very much, My last line was wrong

+2

¿¿¿¿Just give a hint or something????

+2

letter frequency: text = input() letter = input() counter = text.count(letter) frequency = int ((counter/len(text)) * 100) print(frequency)

+2

text = input() letter = input() x = text.count(letter) y = len(text) percentage = (x*100)/y print(int(percentage))

+1

can you put the coding for this question You are making a program to analyze text. Take the text as the first input and a letter as the second input, and output the frequency of that letter in the text as a whole percentage. Sample Input: hello l Sample Output: 40 The letter l appears 2 times in the text hello, which has 5 letters. So, the frequency would be (2/5)*100 = 40.

+1

first = input() second = input() suum = first.count(second) div = len(first) total = (suum / div) * 100 print(int(total))

+1

Here is my solution (hope it helps) text=input() letter=input() count=0 frequency=0 for c in text: if c==letter: count+=1 n=len(text) frequency=(count/n)*100 print(int(frequency))

-2

I need this as well, I'm stuck here. I tried at least 100 times

-3

Just got it correct but I am not sure if I will not be penalised for sharing the solution.