scientific-programming-exer.../ex_14.py

11 lines
912 B
Python

from collections import Counter
names = "Faramarz Christian Mathias Johannes Benedikt Lukas Markus André Felix Maria Christian Georg Luca Niklas Pauline Simon Teresa Robert Muriel Corinna Christina Ahmet Johannes Daniel Patrick Dominik Fabian Florian Urs 1Benedikt Christoph Caspar Alexander Thomas Birgit Leonard Joachim Carina Lisa Daniel Christina Sabrina Lea Nhat Verena Denise Marlene Vincent Maximilian Daniel Niklas Martin Maximilian Enrico Michael Barbara Jakob Luis Cedrik Ronja Elena Alex Furkan Stefano Andriy Valentina Katharina Eva Veronika Kenneth Rudolf Elisabeth Christoph Laurin Daniel Johannes Simon Florian Maximilian Patrick Sebastian Fabian Anastasia Stefan Stefan Jonathan Nico Juliane Niclas Martino Jonas Markus Tuan Maximilian Adrian Stefan Jannis Verena Emily Simon Alexander Kilian Tina Viola"
counter = Counter(names.split())
for k,v in counter.most_common():
print(k, ":", v)