Skip to content

Intermediate level python quiz

What will be the output of the following code: print([1, 2, 3] + [4, 5])?

How can you check if a key exists in a dictionary in Python?

Which of the following is true about Python’s `global` keyword?

Which method is used to add an element at the end of a list in Python?

What will be the result of the following code: print('abc'.upper())?

Which function is used to sort a list in Python without modifying the original list?

What does the `enumerate()` function do in Python?

What is the output of the following code: print(list(map(str, [1, 2, 3])))?

What will be the output of the following code: print(3 * 'a' + 'b')?

What is the purpose of the `@staticmethod` decorator in Python?


J2J Institute private limited