+ 1
Which technique should use even both uses same method and give same output -_-???
string = "hey test string" first = [word for word in string.split(" ")] second = string.split(" ") print(first) print(second) OUTPUT ['hey', 'test', 'string'] ['hey', 'test', 'string']
1 Respuesta
+ 1
i think second is better - it is shorter and you save one loop