+ 1
Help me with this python puzzle
I've this list as follows ['I', 'love', 'code', 'networking', 'Gaming' I need to join the list together without the single quotes and add a slash between the last 3 words
4 Antworten
+ 4
string = ' '.join(list[:-3])+' '+'/'.join(list[-3:])
+ 1
list[:-3] slice the list (get sublist) from start to third last item (not included)
list[-3:] slice the list from third last item to end
str.join() join the list passed as argument with the given string
+ concatenate strings
0
JΞΜΔ 🇨🇩👑 (Active Challenger) any help?
0
visph worked very well. ThankYou. Could you break it down a little bit. I'm trying to understand it