Which technique should use even both uses same method and give same output -_-??? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antwort
+ 1
i think second is better - it is shorter and you save one loop
10th Jan 2018, 3:24 PM
michal