title: Card Game Python, Saving a shuffled deck
body: <p>I am writing a program in Python where the user has to guess if the next card in a pack of playing cards is bigger or smaller than the previous card.
  I've got the whole program to work except for one function.</p>
  
  <p>I have two ways of playing this game. One way is to shuffle the deck of cards and the other way is to play with an un-shuffled deck of cards (some random order I put them in when making a text file). What I want to do is when the user selects to play with a shuffled deck, the shuffled deck is saved and overwrites the un-shuffled deck's text file.</p>
  
  <p>The cards in the text file are saved as two or three digit numbers. </p>
  
  <p>Each suit is numbered as follows:</p>
  
  <blockquote>
    <ul>
    <li>1 - Clubs</li>
    <li>2 - Diamonds</li>
    <li>3 - Hearts</li>
    <li>4 - Spades</li>
    </ul>
  </blockquote>
  
  <p>As far as card numbers go:</p>
  
  <blockquote>
    <ul>
    <li>1 - Ace</li>
    <li>2 - Two</li>
    <li>...</li>
    <li>11 - Jack</li>
    <li>12 - Queen</li>
    <li>13 - King</li>
    </ul>
  </blockquote>
  
  <p>So the <strong>5 of hearts</strong> would be saved as <strong>35</strong>, and the <strong>jack of clubs</strong> would be saved as <strong>110</strong></p>
  
  <p>Here is my code so far.        </p>
  
  <p>This is my attempt at saving:</p>
  
  
  
  <pre><code>def SaveShuffledDeck(Deck):
      CurrentFile = open('deck.txt', 'w')
      Count = 1
  
      for Count in range(1,52+1):
          CardtoaddtoFile = str(Deck[Count].Suit) + str(Deck[Count].Rank) + '\n'
          CurrentFile.write(CardtoaddtoFile)
  
      CurrentFile.close()
  </code></pre>
  
  <p>If you would like to see the rest of the code for the deck, check out <a href="https://pastebin.com/8RYez2V5" rel="nofollow noreferrer">this pastebin link</a></p>