Which of the following is the same as list(map(lambda x: x**-1, [1, 2, 3]))? a) ...
View Question
What will be the output of the following Python code snippet?
print([if i%2==0: i; else: i+1; for i in range(4)])
What will be the output of the following Python code snippet? print([if i%2==0: i; else: i+1; for i ...
View Question
What will be the output of the following Python code snippet?
print([[i+j for i in “abc”] for j in “def”])
What will be the output of the following Python code snippet? print([[i+j for i in "abc"] for j ...
View Question
What will be the output of the following Python code snippet?
print([i+j for i in “abc” for j in “def”])
What will be the output of the following Python code snippet? print([i+j for i in "abc" for j ...
View Question
What will be the output of the following Python code snippet?
print([i.lower() for i in “HELLO”])
What will be the output of the following Python code snippet? print([i.lower() for i in "HELLO"]) a) ...
View Question
What will be the output of the following Python code snippet?
x = [i**+1 for i in range(3)]; print(x);
What will be the output of the following Python code snippet? x = [i**+1 for i in range(3)]; ...
View Question
Which of the following is the correct expansion of
list_1 = [expr(i) for i in list_0 if func(i)]?
Which of the following is the correct expansion of list_1 = [expr(i) for i in list_0 if ...
View Question
What will be the output of the following Python code snippet?
my_string = “hello world”
k = [(i.upper(), len(i)) for i in my_string]
print(k)
What will be the output of the following Python code snippet? my_string = "hello world" k = [(i.upper(), ...
View Question
What is the output of print(k) in the following Python code snippet?
k = [print(i) for i in my_string if i not in “aeiou”]
print(k)
What is the output of print(k) in the following Python code snippet? k = [print(i) for i in ...
View Question
What will be the output of the following Python code snippet?
k = [print(i) for i in my_string if i not in “aeiou”]
What will be the output of the following Python code snippet? k = [print(i) for i in my_string ...
View Question