Function works in python shell alone, but not when called to another function?
<p>I have a homework issue with one of my functions called function 4. 
This is its code:</p>

<pre><code>def getSuit(n):
    suits = []
    if 1 &lt;= n &lt;= 13:
        suits.append("Spades")
        return suits
    if 14 &lt;= n &lt;= 26:
        suits.append("Hearts")
        return suits
    if 27 &lt;= n &lt;= 39:
        suits.append("Clubs")
        return suits
    if 40 &lt;= n &lt;= 52:
        suits.append("Diamonds")
        return suits
</code></pre>

<p>Now the function works as it is if I call it into the shell like so:</p>

<pre><code>&gt;&gt;&gt;getSuit(51)
&gt;&gt;&gt;["Diamonds"]
</code></pre>

<p>However, I am making a new function that sets the value of the card and also calls function 4 to obtain the suit of the card, but when I call the function it only displays ["Spades"] no matter what number is chosen.</p>

<p>Here is the code for Function 5:</p>

<pre><code>def getCard(n):    
n = (n-1) % 13 + 1
deckValue = []
grabSuit = getSuit(n) # Called Function 4 here. &lt;---
if n == 1:
    deckValue.append("Ace")
    return deckValue + grabSuit
if 2 &lt;= n &lt;= 10:
    deckValue.append(str(n))
    return deckValue + grabSuit
if n == 11:
    deckValue.append("Jack")
    return deckValue + grabSuit
if n == 12:
    deckValue.append("Queen")
    return deckValue + grabSuit
if n == 13:
    deckValue.append("King")
    return deckValue + grabSuit
</code></pre>

<p>So now when I call it into the python shell this is my output:</p>

<pre><code>&gt;&gt;&gt;getCard(52)
&gt;&gt;&gt; ["King", "Spades"]
</code></pre>

<p>Whereas it should be:</p>

<pre><code>&gt;&gt;&gt;getCard(52)
&gt;&gt;&gt;["King", "Diamonds"]
</code></pre>

<p>Am I just not calling the functions variable correctly, or do I need to rewrite function 4? I can't seem to figure out as to why it won't display the other suits despite it working just fine alone.</p>

<pre><code>def getCard(n):
grabSuit = getSuit(n) # Called Function 4 here. &lt;--- Move to this line    
n = (n-1) % 13 + 1 
deckValue = []
</code></pre>

python list function python-3.x