All hands on deck

Report a typo

In a standard deck of cards, there are 13 of each suit. There are numbered cards (from 2 to 10) and face cards (Jack, Queen, King, and Ace). If we were to rank the face cards, Jack would be 11, Queen 12, King 13, and the Ace 14.

Write a program that calculates the average rank of one hand of cards. Don't forget to consider the rank of the face cards.

The input format:

Six values of cards, each on a separate line.

The output format:

The average rank of the hand.

Try storing card values in a dictionary!

Sample Input 1:

Ace
4
9
Jack
10
7

Sample Output 1:

9.166666666666666
Write a program in Python 3





___

Create a free account to access the full topic