map
Posted run_qin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了map相关的知识,希望对你有一定的参考价值。
def order():
sentence = "is2 Thi1s T4est 3a"
senList = str.split(sentence)
nums = list(range(1, 10))
nums = map(str, nums)
nums = list(nums)
position = []
for item in senList:
for i in nums:
if i in item:
position.append(i)
print(position)
position = list(map(int, position)) #将position里面的值转换成int
print(position)
for i in range(0, len(position)-1):
for j in range(i+1, len(position)):
if position[i] > position[j]:
tem = position[i]
position[i] = position[j]
position[j] = tem
tem = senList[i]
senList[i] = senList[j]
senList[j] = tem
print(‘ ‘.join(senList))
if __name__ == ‘__main__‘:
order()
以上是关于map的主要内容,如果未能解决你的问题,请参考以下文章
Angular Google Maps - 在 AGM-MAP 标签和使用 map = new google.maps.Map() 之间创建地图差异