Last active
August 19, 2020 07:12
-
-
Save p0rsche/774ab8a25e0d0ffe09c743cc7c429bfc to your computer and use it in GitHub Desktop.
Operations with dictionary - All hands on deck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
faced_cards = {'Jack': 11, 'Queen': 12, 'King': 13, 'Ace': 14} | |
cards_in_hand = [int(x) if faced_cards.get(x) is None else faced_cards.get(x) for x in [input() for _ in range(6)]] | |
print(sum(cards_in_hand)/len(cards_in_hand)) | |
# Sample Input 1: | |
# | |
# Ace | |
# 4 | |
# 9 | |
# Jack | |
# 10 | |
# 7 | |
# Sample Output 1: | |
# | |
# 9.166666666666666 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment