Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6814

Python • Problem with print in a for loop.

$
0
0
With this code I am trying to make a line break after every row,

Code:

query = “SELECT * FROM sensorlog”c.execute(query)for row in c:print(“%s\n” % ("Temperature ",row[1], "C Humitidy ", row[2], "% Date ", row[3]))
but I get this errormessage

TypeError: not all arguments converted during string formatting

Code:

Can someone help me with this problem?

Statistics: Posted by Kenne76 — Mon Dec 15, 2025 11:38 am — Replies 4 — Views 52



Viewing all articles
Browse latest Browse all 6814

Trending Articles