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

11 lines
912 B
Python
Raw Normal View History

2018-11-14 13:10:50 +00:00
from collections import Counter
2018-11-14 13:22:50 +00:00
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"
2018-11-14 13:10:50 +00:00
counter = Counter(names.split())
for k,v in counter.most_common():
print(k, ":", v)