I have this..
the_tuple = (1,2,3,4,5)
print ('\"',the_tuple[1],'\"')
showing
" 2 "
How can I get the output to show "2"
?
Use:
print ('\"',the_tuple[1],'\"', sep='')
^^^^^^
Note that those escapes are completely unnecessary:
print ('"', the_tuple[1], '"', sep='')
Or even better, use string formatting:
print ('"{}"'.format(the_tuple[1]))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With