May-15-2020, 07:15 PM
Hello,
As I read rows from a database and concatenate some columns into a string, some columns are empty.
What is the correct way to ignore those when building the string, and avoid having "None\n"?
As I read rows from a database and concatenate some columns into a string, some columns are empty.
What is the correct way to ignore those when building the string, and avoid having "None\n"?
for row in rows: #How to avoid eg. "Col3 stuff\nNone\nCol 5 stuff" ? bigstring = f'{row["col3"]}\n{row["col4"]}\n{row["col5"]}'Thank you.