Validate Line function in Python

Member

carey

by carey , in category: Python , a month ago

Validate Line function in Python 😁

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def validate_line(line):
    if len(line) <= 2: return False
    if line[0] == '""': return False
    if line[0] == "''": return False
    if line[0] == '+!': return False
    if line[0] == '-?': return False
    if line[0] == '- (': return False
    if line[0] == '-(': return False
    if line[0] == '-)': return False

    if line[0] == '-6a': return False
    if line[0] == '-6a )': return False
    if line[0] == '-a': return False
    if line[0] == '-aa': return False

    if line[0] == '-:': return False
    if line[0] == ':': return False
    if line[0][0] == '#': return False
    if line[0][0] == "'": return False
    if line[0][0] == '&': return False
    if line[0][0] == '(': return False
    return True


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers