Hello TPG'ians Greetings of the Day!!
Suggest Any Project which You wish to be the Next Post Here..
[will be created using django or tkinter]
Suggest Any Project which You wish to be the Next Post Here..
[will be created using django or tkinter]
๐1
What will be the output of the following Python code?
def add_items(val, lst=[]): lst.append(val) return lst result1 = add_items(1) result2 = add_items(2) print(result2)
def add_items(val, lst=[]): lst.append(val) return lst result1 = add_items(1) result2 = add_items(2) print(result2)
Anonymous Quiz
4%
[1]
48%
[2]
46%
[1,2]
2%
[2,1]
๐2
Python
What will be the output of the following Python code?
def add_items(val, lst=[]): lst.append(val) return lst result1 = add_items(1) result2 = add_items(2) print(result2)
def add_items(val, lst=[]): lst.append(val) return lst result1 = add_items(1) result2 = add_items(2) print(result2)
code:
def add_items(val, lst=[]):
lst.append(val)
return lst
result1 = add_items(1)
result2 = add_items(2)
print(result2)
def add_items(val, lst=[]):
lst.append(val)
return lst
result1 = add_items(1)
result2 = add_items(2)
print(result2)
โค1๐1