GOEDUHUB Tutorials    ||    AI    ||    ML  ||    NLP    ||    OpenCV    ||    Python    ||    OOPS    ||    DBMS    ||    DSA    ||    JAVA    ||    Linux    ||    C Programming
7976731765 Go To Your University       ||       Placement Preparation       ||        Technical-MCQ and Interview Questions
Online Live Classes Youtube Live Link
0 like 0 dislike
732 views
in Python Programming by Goeduhub's Expert (8.1k points)

Sample string: 'thequickbrownfoxjumpsoverthelazydog'

occurrence of t word: 2

 occurrence of h word: 2 

occurrence of e word: 3

 occurrence of q word: 1 

occurrence of u word: 2 

occurrence of i word: 1 

occurrence of c word: 1 

occurrence of k word: 1 

occurrence of b word: 1

 occurrence of r word: 2 

occurrence of o word: 4

 occurrence of w word: 1

 occurrence of n word: 1 

occurrence of f word: 1

 occurrence of x word: 1 

occurrence of j word: 1 

occurrence of m word: 1 

occurrence of p word: 1 

occurrence of s word: 1 

occurrence of v word: 1 

occurrence of l word: 1 

occurrence of a word: 1 

occurrence of z word: 1 

occurrence of y word: 1 

occurrence of d word: 1 

occurrence of g word: 1

1 Answer

0 like 0 dislike
by Goeduhub's Expert (8.1k points)
 
Best answer
s=input()

f={}

for i in s:

    if i in f:

        f[i]+=1

    else:

        f[i]=1

print(f)

Related questions

0 like 0 dislike
1 answer 630 views
0 like 0 dislike
2 answers 46 views
0 like 0 dislike
1 answer 640 views
0 like 0 dislike
1 answer 50 views

 Goeduhub:

About Us | Contact Us || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 
 Placements:   List of companies | Logical Reasoning Questions | Quantitative Aptitude Questions | General English Questions | Technical-MCQ and Interview Questions
 Important Lists: List of NITsList of IITsList of Exams After Graduation | List of Engineering Entrance Examinations (UG/PG)College ReviewsCollege Fest, Events & WorkshopsKnowledge ShareTrainees/Interns After 15-04-2020
Exams & Cutoffs: JEE Main | JEE Advanced | GATE | IES | ISROList of PSUs || Cutoff-GATECutoff_IIT-JEECS-ScopeECE ScopeEE-Scope
 Download Previous Year Papers For:  GATE | IES | RAJASTHAN TECHNICAL UNIVERSITY (RTU-Kota)RPSC Technical Exams | ISRO
...