Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
What is the output of the following code snippet?
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
None of the above
my_list = [1, 2, 3, 4] print(my_list[2])
1
2
3
4
my_tuple = (1, 2, 3, 4) print(my_tuple.index(3))
0
my_dict = {"apple": 1, "banana": 2, "orange": 3}print(my_dict["banana"])
apple
banana
my_list = [1, 2, 3, 4] new_list = [x**2 for x in my_list] print(new_list)
[1, 2, 3, 4]
[1, 4, 9, 16]
[2, 4, 6, 8]
my_list = [1, 2, 3] my_list.pop() print(my_list)
[1, 2]
[2, 3]
[1, 3]
my_list = [1, 2, 3] my_list.append(4) print(my_list)
[1, 2, 4, 3]
[4, 3, 2, 1]
my_dict = {"apple": 1, "banana": 2, "orange": 3}print(len(my_dict))
my_list = [1, 2, 3, 4] print(sum(my_list))
10
2.5
5
my_tuple = (1, 2, 3, 4) print(my_tuple[1:3])
(1, 2)
(2, 3)
(2, 3, 4)
(1, 2, 3)