Skip a line by using the continue statement

PHOTO EMBED

Mon Oct 24 2022 05:50:06 GMT+0000 (Coordinated Universal Time)

Saved by @L0uJ1rky45M #python

handler = open('textfile.txt')
for line in handler:
    line = line.rstrip() #rstrip() method removes characters at the end a string. 
    if not line.startswith('From:') : #For this case, we remove any lines between lines staring with "From:""
        continue
    print(line)
content_copyCOPY

https://www.py4e.com/lessons/files#