Reputation: 537
I am trying to increment the count and write the values in an array serialBuffer
in Python.
How can I increment the count value (initially 0)?
if serialIndex < 200:
serialBuffer[serialIndex += 1] = serialData
# i get this error ^ ']' expected
Upvotes: 0
Views: 54
Reputation: 76194
You can't do this on just one line. You'll have to split it up.
if serialIndex < 200:
serialBuffer[serialIndex] = serialData
serialIndex += 1
Upvotes: 2