Reading a deck of cards X95744


Statement
 

pdf   zip   main.py

html

Using the Card and Deck class definitions, write a Deck method

read_cards()

to read a shuffled deck of cards.

Input

The input consists of several cards (three strings for each: the rank, the word of, and the suit).

Output

Print the number of cards, the first card, and the last card in the deck.

Precondition

The deck has at least two cards.

Public test cases
  • Input

    10 of Diamonds
    3 of Spades
    Ace of Spades
    9 of Hearts
    Queen of Clubs
    Jack of Spades
    3 of Hearts
    3 of Diamonds
    Queen of Hearts
    9 of Diamonds
    10 of Spades
    4 of Diamonds
    9 of Clubs
    5 of Hearts
    7 of Clubs
    4 of Spades
    6 of Spades
    7 of Hearts
    6 of Hearts
    Ace of Clubs
    8 of Diamonds
    3 of Clubs
    Ace of Hearts
    King of Diamonds
    5 of Spades
    9 of Spades
    2 of Clubs
    4 of Hearts
    2 of Hearts
    10 of Hearts
    7 of Spades
    King of Clubs
    2 of Spades
    4 of Clubs
    Ace of Diamonds
    Queen of Spades
    6 of Diamonds
    5 of Clubs
    5 of Diamonds
    10 of Clubs
    King of Hearts
    Jack of Hearts
    8 of Clubs
    7 of Diamonds
    8 of Hearts
    Jack of Clubs
    Queen of Diamonds
    6 of Clubs
    2 of Diamonds
    King of Spades
    8 of Spades
    Jack of Diamonds
    

    Output

    52
    10 of Diamonds
    Jack of Diamonds
    
  • Information
    Author
    Gabriel Valiente
    Language
    English
    Official solutions
    Python
    User solutions
    Python