+ 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']

10th Jan 2018, 2:03 PM
RODENT
RODENT - avatar
1 Odpowiedź
+ 1
i think second is better - it is shorter and you save one loop
10th Jan 2018, 3:24 PM
michal