0

Gan i have your help I'm having trouble with this

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.

17th Feb 2021, 11:46 AM
Jhon marvin abadilla
Jhon marvin abadilla - avatar
24 Respuestas
+ 19
text=input() letter=input() x=text.count(letter) print(int((x/len(text))*100)) This also gives correct output!!!!
22nd Aug 2021, 1:36 PM
Reshmaa
Reshmaa - avatar
+ 8
#your code goes here string = input("") string1 = input("") number = 0 i = string1 for i in string: if i == string1: number += 1 #print(number) len = len(string) calc = number/len*100 print(int(calc)) #Thia code worked for me I hope that this helps You
12th Mar 2021, 6:13 AM
Mohamed Alaan
Mohamed Alaan - avatar
+ 3
Answer text = input() letter = input() text_count = 0 letter_count = 0 for i in text: text_count += 1 for i in text: if letter == i: letter_count += 1 letter_percentage = (letter_count/text_count)*100 print(int(letter_percentage))
22nd May 2021, 5:40 PM
HARSHAVARDHAN REDDY
HARSHAVARDHAN REDDY - avatar
+ 2
like (: text = input("") # hello letter = input("") # l count = text.count(letter) # 2 length = len(text) # 5 calculate = (count / length) * 100 print(int(calculate))
17th Sep 2021, 1:45 AM
MORTEZA ABDOLLAHI
MORTEZA ABDOLLAHI - avatar
+ 1
#your code goes here string = input("") string1 = input("") number = 0 i = string1 for i in string: if i == string1: number += 1 #print(number) len = len(string) calc = number/len*100 print(int(calc)) for any answer follow me on sololern
22nd Apr 2021, 12:34 PM
Budhabhushan Waghmare
Budhabhushan Waghmare - avatar
+ 1
string = input("") string1 = input("") count = 0 i = string1 for i in string: if i == string1: count+=1 length = len(string) freq = (count/length)*100 print(int(freq)) try to get this code ;) , it is easy HAPPY LEARNING :)
16th May 2021, 5:58 PM
Sai Sandeep Chindukuru
Sai Sandeep Chindukuru - avatar
+ 1
x = input() y = input() #length of full character full = len(x) #counting how many times the character has appeared single = (x.count(y)) print(int((single/full)*100)) # this code will give you the perfect output
5th Jun 2021, 12:38 AM
Sarthak Gajanan Shejole
Sarthak Gajanan Shejole - avatar
+ 1
text = input() letter = input() Freq = text.count(letter) ltext = len(text) Frequency = int((Freq / ltext) * 100) print(Frequency)
8th Jun 2022, 2:51 PM
Rahul Musale
Rahul Musale - avatar
+ 1
text=input() letter=input() count=text.count(letter) lenght=len(text) print(int(count/lenght*100))
2nd Jul 2022, 11:42 AM
SHAIKH MOHAMMED SAIF
SHAIKH MOHAMMED SAIF - avatar
0
Please post your attempt also.
17th Feb 2021, 12:09 PM
XXX
XXX - avatar
0
try this code it works for me word = input() char = input() result = (word.count(char)/len(word))*100 print(int(result))
28th May 2021, 4:07 AM
Abhishek Biswas
Abhishek Biswas - avatar
0
string = input() letter = input() count = 0 string = string.upper() letter = letter.upper() for i in string: if i == letter : count += 1 frequency = int((count/len(string))*100) print(frequency) This is the answer and you can take out the two lines after count if you want to. They are redundant. However, I used it to make it a perfect code that returns no issue.
11th Jun 2021, 7:23 AM
Yaswanth Raj
Yaswanth Raj - avatar
0
#your code goes here str = input() letter = input() freq = (str.count(letter)/len(str))*100 print(int(freq))
30th Jun 2021, 6:55 PM
Shanmuga Priya
Shanmuga Priya - avatar
0
#your code goes here text = input() letter = input () result = (text.count(letter)/len(text))*100 print (int(result))
24th Jul 2021, 7:50 PM
Mwaniki Grace Waigumo
Mwaniki Grace Waigumo - avatar
0
text=input() letter=input() x=text.count(letter) print(int((x/len(text))*100))
1st Jan 2022, 6:12 PM
Md. Rakibul Islam
Md. Rakibul Islam - avatar
0
x = input() y = input() a = x.count(y) b = len(x) c = a/b*100 print(int(c))
7th Jan 2022, 5:32 PM
Ravindra Devaliya
Ravindra Devaliya - avatar
0
This worked for me! word = str(input()) letter = str(input()) count = word.count(letter) print(int((count/len(word))*100))
11th Feb 2022, 2:55 AM
Zachary Blaine
Zachary Blaine - avatar
0
x = str(input()) y = str(input()) print(int(x.count(y) / len(x) * 100))
12th Feb 2022, 12:47 PM
Erika
0
try this solution x = str(input()) y = str(input()) v = x.count(y) w = len(x) a = v/w b = a*100 print(int(b))
8th Jun 2022, 4:54 PM
Princi Patel
Princi Patel - avatar
0
x = input() y = input() print (int((x.count(y)*100/len(x)))) people like to overcomplicate things here
22nd Jun 2022, 7:55 PM
Nishkarsh Pandey
Nishkarsh Pandey - avatar