Ask Your Question
0

How to correct this Error?

asked 9 years ago

Chernoxyl gravatar image

I was using the Cartesian Product function when it gave me an "unhashable list" error. What does this mean and how would I correct it?

As for code, I used the Cards, Values, and Suits from the Combinatorics Comprehensive Module Index.

Preview: (hide)

Comments

2

Could you be more precise? Could you write down the code you were using?

vdelecroix gravatar imagevdelecroix ( 9 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 9 years ago

fidbc gravatar image

Perhaps doing it as shown here might help (code below).

sage: Suits = Set(["Hearts", "Diamonds", "Spades", "Clubs"])
sage: Values = Set([2, 3, 4, 5, 6, 7, 8, 9, 10,
...                 "Jack", "Queen", "King", "Ace"])
sage: Cards = CartesianProduct(Values, Suits)

Just ran this code and it didn't produce any errors.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 471 times

Last updated: Oct 09 '15