vendredi 31 mai 2019

Why is only the If Statement Reached and not the else while the STATE.txt is acutally empty?

def checking():
    fp = open("STATE.txt", "w+")
    if "!" or "§" in fp.read():
        print(fp.read())
        read = fp.read()
        print(read)
    else:
        fp.close()
        no_entry()
    fp.close()


checking()

Output:

Process finished with exit code 0

Why is this Output Empty but my Code thinks its not?

Aucun commentaire:

Enregistrer un commentaire