Python script which take string as input from user and prints number of occurrences of character used in given string | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Python script which take string as input from user and prints number of occurrences of character used in given string

For ex., input string = "Python" p = 1 y = 1 t = 1 h = 1 o = 1 n = 1 Note:- please give all logics as many as possible

23rd Jan 2018, 4:31 AM
Devang Prajapati
Devang Prajapati - avatar
2 Antworten
+ 2
text = input().lower() # make a set of unique letters then count them [print(k,'=',text.count(k)) for k in set(text)] https://code.sololearn.com/cmDZ8xM4cSg6/#py
23rd Jan 2018, 7:14 AM
richard