Upper method doesn't make sense
<p><strong>Code</strong>:</p>

<pre><code>def solve_the_input(port):
    port = hex(int(port))
    split_result = port.split("0x")
    split_port = split_result[1]
    print 'input port is ',split_port
    split_port.upper()
    print 'input port is ',split_port
    return split_port

if __name__ == "__main__":
    if len(sys.argv) == 1:
        print "please input a port"
    else:
        port = solve_the_input(sys.argv[1])
</code></pre>

<p><strong>Input</strong></p>

<pre><code>python test.py 42328
</code></pre>

<p><strong>Actual Output</strong>:</p>

<pre><code>input port is  a558
input port is  a558
</code></pre>

<p><strong>Expected Output</strong>:</p>

<pre><code>input port is  a558
input port is  A558
</code></pre>

<p>I don't know why the upper() method is not working as expected.</p>

<p>The upper method returns <em>new</em> string in uppercase. So use</p>

<pre><code>split_port = split_result[1].upper()
</code></pre>

python