How do I just display the numbers from the list without the comma and brackets on Python?
<pre><code>#This will ask the user to enter a 7 digit number
#then it would calculate the modulus 11 check digit
#then would show the user the complete 8 digit number

weight=[8,7,6,5,4,3,2]
number= input("Please enter your 7 digit number: ")

#If the user enters more than 7 characters it will prompt the user to try again
while len(number) &gt; 7:
    number=input ("Error! Only 7 numbers allowed! Try again: ")

#This puts the 7 digit number into a list
account_number=number

#This converts the string in the list into a integer
account_number = [int(i) for i in account_number]

#This separates the numbers into multple values every character
list(account_number)

#This multiplies the account number by the weight
num1=weight[0]*account_number[0]
num2=weight[1]*account_number[1]
num3=weight[2]*account_number[2]
num4=weight[3]*account_number[3]
num5=weight[4]*account_number[4]
num6=weight[5]*account_number[5]
num7=weight[6]*account_number[6]

#This adds up the all the answers above
num8=num7+num6+num5+num4+num3+num2+num1

#The use of % divides the number and gives the remainder
remainder=num8%11

#This generates the final check digit
check_number=11-remainder

#This adds the check number to the 7 digit number (account number)
account_number.insert(7,"{0}".format(check_number))

#This gives the user the total 8 digit number
print ("Your account number is {0}".format(account_number))
</code></pre>

<p>At the end, the account number is displayed like <code>[1,2,3,4,5,6,7]</code>. How can I display it like <code>1234567</code>, without commas and square brackets?</p>

<pre><code>&gt;&gt;&gt; "".join(map(str,account_number))
</code></pre>

<p>This first converts ints to str, then joins them together with no spaces</p>

<p>example:</p>

<pre><code>&gt;&gt;&gt; a = [1,2,3]
&gt;&gt;&gt; map(str,a)
['1', '2', '3']
&gt;&gt;&gt; "".join(map(str,a))
'123'
&gt;&gt;&gt; 
</code></pre>

<p>In your case, change to this: </p>

<pre><code>account_number = "".join(map(str, account_number))
print ("Your account number is {0}".format(account_number))
</code></pre>

<p>follow up to comment:</p>

<pre><code>while len(number) != 7:
    number=input ("Error! Only 7 numbers allowed! Try again: ")
</code></pre>

python algorithm