+ 2

Doubt on Data structure

Teacher, we can't use methods of a string with a list, or with any other data structure? My question is that there are different methods for different data structures, so we can't use them with each? Suppose we want to use the spite(), and append() method in a program then can we use them together?

5th May 2021, 5:58 AM
Gouri Shinde
Gouri Shinde - avatar
1 Answer
+ 1
def split_food(input, food_list): #split the input words = input.split() for i in words: food_list.append(i) return food_list
5th May 2021, 6:27 AM
HĂ«llo Wörld🔰
HĂ«llo Wörld🔰 - avatar