-4
我正在使用字符串模塊,並好奇如何從string.printable調用索引100?Python:如何調用index 100
len(string.printable)
100
string.printable[98]
'\x0b'
string.printable[99]
'\x0c'
string.printable[100]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: string index out of range
大概聽起來很奇怪。我知道我可以使用string.printable [-1],但我使用這個項目。