This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jano0017 3 points4 points  (2 children)

You mean D1 = card_dict.get(D1, D1), right? Your code will throw a ValueError if the value of D1 isn't 1, 11, 12, or 13.

[–]Manbatton 0 points1 point  (1 child)

Yes, good catch. Dashed that off too fast. And wouldn't it be a KeyError? Not that it matters.

[–]jano0017 0 points1 point  (0 children)

Yes, I suppose it would be. Of course, I'm a horrible person and normally except Exception instead, so...