← 返回列表

Python3 列表List Index 方法

Python3 列表List Index 方法 #!/usr/bin/python3 list1 = ['physics', 'chemistry', 'maths'] print ('Index of chemistry', list1.index('chemistry')) print ('Index of C#', list1.index('C#'))

Python3 列表List Index 方法

#!/usr/bin/python3

list1 = ['physics', 'chemistry', 'maths']
print ('Index of chemistry', list1.index('chemistry'))
print ('Index of C#', list1.index('C#'))

打开资源 ↗

交流与评论