why this split() doesn't work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

why this split() doesn't work?

str2="F_i_s_h" str2.split(sep='_') print(str2) Output: F_i_s_h

27th Dec 2018, 11:09 AM
sky
sky - avatar
2 Answers
27th Dec 2018, 11:30 AM
Bipin Tatkare
Bipin Tatkare - avatar
+ 5
str1 = "F_i_s_h" str2 = str1.split('_') print(str2) It works like this. When you split any string, you need to store that value into another string.
27th Dec 2018, 11:14 AM
Raj Chhatrala
Raj Chhatrala - avatar