, pos)
    
    def flip_cards(self):
        for card in self.cards:
            card.set_face_down(False)
        
# define deck class 
class Deck:
    def __init__(self):
        self.cards = []
        for suit in SUITS:
            for rank in RANKS:
                card = Card(suit, rank)
                self.cards.append(card)

    def shuffle(self):
        random.shuffle(self.cards)

    def deal_card(self):
        card = self.cards[0]
        self.cards.remove(card)
        return card
    
    def __str__(self):
        deck_string = ""
        for card in self.cards:
            deck_string += str(card) + " "
        return deck_string

deck = Deck()

#define event handlers for buttons
def deal():
    global outcome, in_play, dealers_hand, players_hand, deck, score
    outcome = "Hit or Stand?"
    if in_play:
        outcome = "You were already playing and now lost a point for giving up!"
        print outcome
        score -= 1
        in_play = False
    
    in_play = True
    deck.shuffle()
    dealers_hand = Hand()
    players_hand = Hand()	
    players_hand.add_card(deck.deal_card())
    players_hand.add_card(deck.deal_card())
    dealers_hand.add_card(deck.deal_card())
    dealers_second_card = deck.deal_card()
    dealers_second_card.set_face_down(True)
    dealers_hand.add_card(dealers_second_card)
    print "Dealer's hand " + str(dealers_hand)
    print "Player's hand " + str(players_hand) + " Value " + str(players_hand.get_value())
 
    if dealers_hand.get_value() == 21:
        dealers_hand.flip_cards()
        outcome = "Dealer gets Blackjack.  Dealer wins. Press the Deal button for a new game."
        score -=1
        in_play = False
        print outcome
        outcome = "No hand in play.  Press the Deal button for a new game."
        print outcome
    elif players_hand.get_value() == 21:
        dealers_hand.flip_cards()
        outcome = "Player gets Blackjack.  Dealer has chance to tie ( and win). Press Stand button to continue."
        print outcome
        

def hit():
    global in_play, score, outcome
    # if the hand is in play, hit the player
    if in_play:
        players_hand.add_card(deck.deal_card())
        print "Dealer's hand " + str(dealers_hand) 
        print "Player's hand " + str(players_hand) + " Value " + str(players_hand.get_value())
    # if busted, assign a message to outcome, update in_play and score
        if  players_hand.get_value() > 21 and in_play:
            outcome = "Player Busted and lost a point! New Deal?"
            print outcome
            in_play = False
            score -= 1
        elif players_hand.get_value() == 21 and in_play:
              outcome = "Player gets Blackjack.  Dealer has chance to tie (and win!). Press Stand button to continue."
        print outcome 
    else:
        outcome = "No hand in play.  Press the Deal button for a new game."
        print outcome
         
       
def stand():
    global in_play, score, outcome
    dealers_hand.flip_cards()
    # if hand is in play, repeatedly hit dealer until his hand has value 17 or more
    while dealers_hand.get_value() < 17 and in_play:
        outcome = "Dealer hits"
        print outcome
        dealers_hand.add_card(deck.deal_card())
        print "Dealer's hand " + str(dealers_hand) + " Value " + str(dealers_hand.get_value())
        print "Player's hand " + str(players_hand) + " Value " + str(players_hand.get_value())
    if dealers_hand.get_value() > 21 and in_play:
        outcome = "Dealer Busted!  Press the Deal button for a new game."
        print outcome
        score +=1
        in_play = False
    else:
        if dealers_hand.get_value() >= players_hand.get_value() and in_play:
            outcome = "Dealer wins!  Press the Deal button for a new game."
            score -= 1
            print outcome
            in_play = False
        elif in_play:
            outcome = "Player wins!  Press the Deal button for a new game."
            print outcome
            score += 1
            in_play = False
        elif in_play == False:
            outcome = "No hand in play.  Press the Deal button for a new game."
        print outcome
# draw handler    
def draw(canvas):
    global outcome,  players_hand, dealers_hand
    canvas.draw_text("Blackjack",[30,50],40,"White")
    canvas.draw_text("Score "+str(score),[300,50],40,"White")
    
    canvas.draw_text("Dealer",[30,140],30,"White")
    canvas.draw_text("Showing " + str(dealers_hand.get_value()), [120, 140], 30, "White")
    #canvas.draw_text(str(dealers_hand), [300, 100], 30, "Red")
    dealers_hand.draw(canvas, [200,75])
    
    canvas.draw_text(outcome,[30,220],20,"Yellow")
    
    canvas.draw_text("Player",[30,300],30,"White")
    #canvas.draw_text(str(players_hand), [300, 200], 30, "Red")
    canvas.draw_text("Showing " + str(players_hand.get_value()), [120, 300], 30, "White")
    players_hand.draw(canvas, [200,250])
  
 
frame = simplegui.create_frame("Blackjack", 800, 400)
frame.set_canvas_background("Green")

#create buttons and canvas callback
frame.add_button("Deal", deal, 200)
frame.add_button("Hit",  hit, 200)
frame.add_button("Stand", stand, 200)
frame.set_draw_handler(draw)


# get things rolling
deal()
frame.start()


# remember to review the gradic rubricNot paying for what you took from an unknown guy who trusted u. Keeping (probably using) his gimble for weeks without returning or paying for it. Ignoring his messages and giving fake promises to return it. This is also "frustrating" brother. 

 Everybody know what you did and who you are.

Its ok though. You did a good thing finally. Thanks!Could your corporation profit from the expertise of a enterprise financial advisor? For some, it may prove the difference between success and failure. I then decided to get skilled assist to solve my downside. After having obtained many quotations from numerous companies, i decided to go forward with Online Tech Restore (). Present refers to a period of lower than 12 months and non-current is any interval better than 12 months. Present belongings will embody items that are more likely to be turned into cash within a twelve month interval comparable to money within the bank, monies owed from clients (known as debtors) and stock.
The key motive that troubles folks is their lack of knowledge about financial elements of enterprise. They’re all stuffed with power, enthusiasm, eagerness and complete heartedly dedicate them to their dream mission, and the aggravation starts increase when they discover themselves caught up and in no capacity to address the constantly coming challenges. Educational hours invested to grasp enterprise finance render one sided flavor. Educational content material offers limited information about the do’s and don’ts as they’re required from a marketable standpoint. This lacks in its pragmatic method towards letting the reader know about planning and managing the phases of startup, growth, transition or decline. For a enterprise proprietor or manager this is a number of inches away from real, sensible world and relating it to your work turns into a confusing endeavor.
Thanks everyone. You might have stopped me from making a big mistake. It is rather good speaking about your expertise. Thanks for sharing. Feel free to set the bar high. Some