0
How to change st in a list
i want to put a couple of items in a list into one for example A=[s,a,r,a] How can i change it to [sara]
6 odpowiedzi
0
A=[s,a,r,a] means s,a,r,a, are 4 variables. for characteruse '' in each character.
A = ['s','a','r','a']
Here is your solution.
def change(list):
reasult = ''
for i in list:
reasult+=i
return reasult
A = ['s','a','r','a']
b=change(A)
c=[]
c.append(b)
print(c)
OUTPUT: ['sara']
0
b=change(A)
b is not defined
0
What do you mean by b is not defined. b will keep the value change function returns.
0
there is no function with change change(A) doesnt work
0
0
can i have your number??