Im a beginner and im tryin to do a couple things.
#1. i want to def a function "func(ListOWord s)" for exampleand what i want it to do is take a list of words for example (["dod","fre","sd f","ser","ftre" ,"dfr"]) and i want it to split them at the commas and rewrite them printing everyother word first then the remaining words after. that sounds alittle weird but it should look like this:
>>>func(["dod","fre","sd f","ser","ftre" ,"dfr"])
["dod","sdf","ft re"],["fre","ser","df r"]
anyone know how to do this?
this is what i got so far
def func(ListOWords ):
[i.split() for i in ListOWords]
return ListOWords
can someone please help.
#1. i want to def a function "func(ListOWord s)" for exampleand what i want it to do is take a list of words for example (["dod","fre","sd f","ser","ftre" ,"dfr"]) and i want it to split them at the commas and rewrite them printing everyother word first then the remaining words after. that sounds alittle weird but it should look like this:
>>>func(["dod","fre","sd f","ser","ftre" ,"dfr"])
["dod","sdf","ft re"],["fre","ser","df r"]
anyone know how to do this?
this is what i got so far
def func(ListOWords ):
[i.split() for i in ListOWords]
return ListOWords
can someone please help.
Comment