• cloudytechi147

    I have this python copy directory:

    {128: ['S', 'S', 'O', 'F'], 512: ['S', 'F']}
    

    I would like to be sure that each key has exactly one value 'F' and one value 'S' and return a message if it's not the case

    I tried this but it didn't seem to work: it didn't print the message

    for key in d:
        if not re.search(r"[F]{1}","".join(d[key])) or not re.search(r"[S].{1}","".join(d[key])):
            print(f"There is no start or end stop for the line {i}.")
    

    Thanks in advance

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!