I am not able get the sorted values from the input
<p>problem with sorting</p>

<pre><code>a = raw_input("Do you know the number of inputs ?(y/n)")    
if a == 'y':    
   n = int(input("Enter the number of inputs : "))    
   total = 0    
   i = 1    
  while i &lt;= n:     
   s = input()    
   total = total + int(s)    
   i = i + 1    
   s.sort()    
   print s     
   print('The sum is ' + str(total))
</code></pre>

<p>Because you are trying to <code>sort</code> on input. <code>sort</code> only work on iterating like list and tuples.  </p>

<p>I just rewrite your code,</p>

<pre><code>a = raw_input("Do you know the number of inputs ?(y/n)")
if a == 'y':
    n = int(input("Enter the number of inputs : "))
    inputs = [] 
    for i in range(n):
        s = input()
        inputs.append(int(s))
    inputs.sort()

    print inputs 
    print('The sum is ',sum(inputs))
</code></pre>

<p><strong><em>Edit</em></strong></p>

<p>Just change whole operation into a function and put yes/no question in a while loop, And for wrong entry exit from program.</p>

<pre><code>def foo():
    n = int(input("Enter the number of inputs : "))
    inputs = [] 
    for i in range(n):
        s = input()
        inputs.append(int(s))
    inputs.sort()

    print inputs 
    print('The sum is ',sum(inputs))

while True:
    a = raw_input("Do you know the number of inputs ?(y/n)")    
    if a == 'y':
        foo()       
    elif a == 'n':
        print 'We are giving one more option.'      
        continue
    else:
        print 'Wrong entry'
        break
</code></pre>

python