方法一:在for循环中使用type() 运算符 通过使用 type() 操作符我们可以从列表中获取字符串元素的索引,字符串元素将属于 str() 类型,所以我们用 for 循环遍历整个列表并返回字符串类型的索引。 Python3实现 # create a list of names and marks list1=['sravan',98,'harsha','jyothika', 'deepika',78,90...
函数:split() Python中有split()和os.path.split()两个函数,具体作用如下: split():拆分字符串。