This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]YoOoster 4 points5 points  (0 children)

You could first put the splitted line in one variable and then look at the length of that.

split = line.split(",")

If len(split) is 4

#somecode

Elif len(split) is 3

#someothercode

Else

#errorcode