これが機能する理由:
s = 'xyz'
i = 0
while i < len(s) and s[i] not in 'aeiou':
print(s[i])
i += 1
x y z
...しかし、これはそうではありませんか?
s = 'xyz'
i = 0
while s[i] not in 'aeiou' and i < len(s):
print(s[i])
i += 1
x y z Traceback (most recent call last): File "<pyshell#135>", line 1, in <module> while s[i] not in 'aeiou' and i <= len(s): IndexError: string index out of range
私は混乱しています、私はここで何が欠けていますか?