From 683c8bf233c9d519fd45dadce85ffb6695fecd98 Mon Sep 17 00:00:00 2001 From: Jethro Stapelbroek Date: Sun, 2 Jul 2023 22:29:37 +0200 Subject: [PATCH] Poker Hand --- pokerhand.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 pokerhand.py diff --git a/pokerhand.py b/pokerhand.py new file mode 100644 index 0000000..1e2a2f3 --- /dev/null +++ b/pokerhand.py @@ -0,0 +1,10 @@ +cards = input().split() +ranks = [c[0] for c in cards] +sranks = set(ranks) +strength = [0, None] +for sr in sranks: + s = ranks.count(sr) + if s > strength[0]: + strength[0] = s + strength[1] = sr +print(strength[0])