Ask Your Question
0

How to correct this Error?

asked 2015-10-09 02:58:51 +0100

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.

edit retag flag offensive close merge delete

Comments

2

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

vdelecroix gravatar imagevdelecroix ( 2015-10-09 04:44:13 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-09 18:57:44 +0100

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.

edit flag offensive delete link more

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: 2015-10-09 02:58:51 +0100

Seen: 453 times

Last updated: Oct 09 '15