0
Hi can anyone explain me this. It does not work
def spl(xx:yy) m=["xx","yy"] return m
6 Respuestas
+ 1
To use a function, you need to call or invoke it..
spl("a", "b")
But also what it meaning there xx:yy in defination? May you are meaning (xx, yy) but again xx (variable) is different than "xx" (String literal)
what are your try there ?
edit:
def spl(xx,yy)
m=[xx,yy]
return m
lst = spl("a", "b")
print(lst)
0
Ok i will try this
0
Hi sorry i couldn't check
That it should divide a variable
If input is = "hiworld"
This function should output ["hi","world"]
0
What is the key to divide there?
For example, if input= "abcdefg", what is your expected output? Mohamed Raaid
0
May you are trying splitting input by a space, then read about split() function again... See there examples...
Hope it helps..
0
Hi split function only splits sentence but it does not separate words
Split function work as below
Eg:- x= "hi world"
x.split()
Outputs-["hi","world"]
But i need to get as below
x="hi"
And that defineed function should output as-["h","i"]