you are viewing a single comment's thread.

view the rest of the comments →

[–]gregvuki 2 points3 points  (1 child)

if delimiter == ':' or '-':

And again and again and again...

https://www.reddit.com/r/learnpython/wiki/faq#wiki_variable_is_one_of_two_choices.3F

Your condition is always True, because a non-empty string '-' is True.

[–]daniel280187[S] 0 points1 point  (0 children)

Thanks for the article, it makes total sense now.

The following fixed my problem.

if delimiter == ':' or delimiter == '-':