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
What will be the output of the following code?
x = "hello" print(x[::-1])
x = "hello" print(x[::-1])
Anonymous Quiz
13%
hello
71%
olleh
10%
error
6%
h e l l o
โค3
What is the output of the following code?
print(bool("False"))
print(bool("False"))
Anonymous Quiz
38%
False
38%
True
7%
None
18%
Error
โค3
What is the output of the following code?
x = 10
def outer():
x = 5
def inner():
nonlocal x
x += 1
return x
return inner
f = outer()
print(f())
print(f())
A)
B)
C)
D)
x = 10
def outer():
x = 5
def inner():
nonlocal x
x += 1
return x
return inner
f = outer()
print(f())
print(f())
A)
6 7B)
11 12C)
5 6D)
Error