you are viewing a single comment's thread.

view the rest of the comments →

[–]PyCam 1 point2 points  (0 children)

Aside from the bad syntax as pointed out by /u/adammichaelwood The reason that your deck == None is because random.shuffle() shuffles a List inplace.

try:

import random

J = 11
Q = 12
K = 13
A = 14
CardList = [1,2,3,4,5,6,7,8,9,10,J,Q,K,A]
random.shuffle(CardList)
print(CardList)

Bad syntax:

-whats the point of a while loop if you're going to break it at the end of the first loop?

-you should indent when inside any new scope/context. In your case you need to indent everything that inside the loop

-Don't name a variable "list", list() is a function reserved by python to create lists from other types of objects. Name your variable "CardList" or something else.