0
what is the output of this code and how ?
lst=["1","2","3"] lst[ : ]="999" print(lst)
2 Respuestas
+ 5
This is basically the same as:
lst = list("999")
It takes an iterable and appends each of its value to the list, in this case "999" is iterable so the list will become:
['9', '9', '9']
+ 3
It print ["9","9","9"]
It is because lst takes value one by one from string and make list . Here lst[ : ] means starting index value 0 to end .