Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
What is the output of the following code snippet?
my_list = [1, 2, 3] my_list.append(4) print(my_list)
[1, 2, 3, 4]
[1, 2, 4, 3]
[4, 3, 2, 1]
None of the above
my_tuple = (1, 2, 3, 4) print(my_tuple[1:3])
(1, 2)
(2, 3)
(2, 3, 4)
(1, 2, 3)
print("5 + 5 =", 5 + 5)
10
5 + 5 = 10
5 + 5
5 + 5 =10
my_list = [1, 2, 3, 4] new_list = map(lambda x: x**2, my_list) print(list(new_list))
[1, 4, 9, 16]
[2, 4, 6, 8]
my_dict = {"apple": 1, "banana": 2, "orange": 3}print(my_dict["banana"])
apple
1
banana
2
my_list = [1, 2, 3] my_list.pop() print(my_list)
[1, 2]
[2, 3]
[1, 3]
print("My name is", "John", "and I am", 25, "years old.")
My name is John and I am 25 years old.
My name is and I am years old.
John 25
my_string = "Hello, World!" print(my_string.replace("World", "Python"))
Hello, World!
Hello, Python!
Python, World!
my_list = [1, 2, 3, 4] new_list = [x**2 for x in my_list] print(new_list)
my_dict = {"apple": 1, "banana": 2, "orange": 3}print(len(my_dict))
3