MySQL Forums
Forum List  »  Connector/Python

Printing array values
Posted by: wryfhk22 jiji
Date: April 13, 2011 10:25PM

I'm trying to do this:
Code:
myArray = "value1","value2","value3","value4"
print("%s,%s,%s,%s"%myArray)
obviously it doesn't work, but is there a way to do that and avoid listing all every single element?

I'm trying to avoid doing this:
Code:
myArray = "value1","value2","value3","value4"
print("%s,%s,%s,%s"%(myArray[0],myArray[1],myArray[2],myArray[3]))

Options: ReplyQuote


Subject
Written By
Posted
Printing array values
April 13, 2011 10:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.