Is there a way to create a list using both strings and a generator (for loop).
list() only takes one argument. The only way I can see so far is:
row = ['string1','string2']+list((t.string3[-7:]) for t in tobject)
What am I missing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you need to do it in only one line?
chain()works, but it looks so unreadable to me. The following is probably less elegant, but I think it’s far more readable: