Which technique should use even both uses same method and give same output -_-??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answer
+ 1
i think second is better - it is shorter and you save one loop
10th Jan 2018, 3:24 PM
michal