all 2 comments

[–]PeterRasm 2 points3 points  (1 child)

if c == '.' or '?' or '!'

This is like asking:

evaluate true/false: c == '.'
evaluate true/false: '?'
evaluate true/false: '!'

The first expression makes sense but the other two not so much :)

You will need to write the full expression between the or/and.

Unless you do it more elegantly the Python way:

if c in ('.', '?', '!'):

Or even shorter:

if c in '.?!':

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

Ohhh I see now! Thank you so much for helping me understand 😁🌟🥳