Python
I'm a beginner at python can someone help me out it's for a course at uni and I keep trying to use VB commands lol
# Playing Cards - Poker
#
# THE PROBLEM
#
# Assume the following value has already been entered into the
# Python interpreter, representing a hand of playing cards -
# where picture cards have the following values:
# Ace = 1; Jack = 11; Queen = 12; King = 13
#
# The cards are grouped into the four suits (Hearts, Diamonds,
# Clubs, Spades, in that order) using sub-lists of the hand.
hand = [[5], [], [6, 8], [4, 7]]
# Write an expression, or expressions, to find the card with the
# highest face value in the hand, regardless of suit,
# and print its value.
#
# (Motivation: Sometimes in poker it is necessary to compare players'
# largest cards in order to determine the winning hand.)
# A SOLUTION
#
# Problem solving strategy:
# 1. Combine the sublists into one list
# 2. Find the highest card
# 3. Print that card's value
|