How do you output a list out without quotes around strings?
<p>I'm trying to set up a block to accept only inputs that are in a list but first it asks for the inputs in the input function but I can't seem to get rid of the quotes around the strings in the list. Here is some example code:</p>

<pre><code>def Sinput(acceptable):
    while True:
        acceptable = [str(i) for i in acceptable]
        a = input('Enter'+str(acceptable[:-1]).strip('[]')+' or '+str(acceptable[-1]+': '))
        if a in acceptable:
            return a
            break

a = Sinput([ 1, 2.01, '\'cat\'', 'dog'])
print('you entred:', a)
</code></pre>

<p>The input asks: <code>Enter'1', '2.01', "'cat'" or dog:</code> I want it to ask: <code>Enter 1, 2.01, 'cat' or dog:</code></p>

<p>Using <code>.replace('\'', '')</code> won't work because the input 'cat' would no longer display correctly</p>

<p>Thanks for any help, I've only been doing coding for about a week.</p>

<p>Use <a href="https://docs.python.org/2/library/stdtypes.html#str.join" rel="nofollow"><code>.join(...)</code></a> which is the recommended way for joining an iterable of strings:</p>

<pre><code>a = input('Enter'+ ' ,'.join(acceptable[:-1]) + ...)
#                  ^^^^^^^^^
</code></pre>

<p>P.S. I don't see why you need a <code>break</code> after that <code>return</code> statement.</p>

python python-3.x