I am trying to learn the functionality of map() in python
Now when i do this,
bits = ['and', '2', '3', '1']
ports = map(int, bits)
#The below line is for the next iteration, where plus_net can be considered a counter
ports = [p+_plusnet for p in ports]
Now bits is a list here, And when I try to map() to iterate along ports, I get the error,
ValueError: invalid literal for int() with base 10: 'and'
Not sure how to handle this.
Suggestions?
Thanks !
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…