您的代码存在很多问题,我已对其进行了更正并提供了评论,以便您学习。
import random
def rollDie(pot): #we need pot defined, so pas the value of the pot in
die1 = [1,2,3,4,5,6]
die2 = [1,2,3,4,5,6]
random.shuffle(die1) #.shuffle works in place so die1 is modified it returns None
random.shuffle(die2) #same as above
#ALL of the above is essentially redundant, use randint(1,6) below instead
dieFace1 = die1[0] #this is superflous, use randint(1,6)
dieFace2 = die2[0] #this is superflous, use randint(1,6)
dieFaceTotal = dieFace1+dieFace2
userIn = int(raw_input("Bet: ")) #use input for python 3
while (userIn > pot or userIn < 0): #pot was passed in from function call
userIn = int(raw_input(" Invalid bet, please enter the right bet amount")) #again input for Python 3, we also need to conver to int
return dieFace1, dieFace2
dieFace1, dieFace2 = rollDie(5) #store the values retuned in dieFace1 and dieFace2 THESE are in scope for this block level
print "You rolled a ", dieFace1, "and ", dieFace2 #ensure names are capitialised