I expect below code to work properly, since first condition if false, but it throughs IndexError: string index out of range. What am I missing?
IndexError: string index out of range
a = False sample_strign = 'test' if (a == True) & (sample_strign[7] == 's'): print('foo')
Aucun commentaire:
Enregistrer un commentaire