Hi,
I need some help on how to read a file
2 h
3 s
6 d
Ace s
...
Importing this into Python and then sorting and printing in order.
I have done some work, yet I can never seem to get the data to Python and split it accordingly>
Class Card:
def __init__(self, rank, suit):
'''Indicates rank from 1-13, as well as the card's 4 different suits'''
self.rank = rank
self.suit = suit
self.ranks = [None, "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"]
self.suits = ["Spades","Diamonds","clubs","hearts"]
self.BJ = [None, 11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
How do I split the file into the two pieces ie 2 h to equal 2 and Hearts.
macca1111