Python Quiz- USS Pvt. Ltd

Follow Us:

Python Quizz

Home Python Quiz

Python Quizz

Test your Python knowledge! 🚀 Take our tech quiz to sharpen your skills, challenge your understanding, and compete with others. Start quizzing today!

1 / 14

1. Which module is used for creating processes in Python?

2 / 14

2. What is the purpose of the GIL (Global Interpreter Lock) in Python?

3 / 14

3. What is the purpose of the await keyword in Python?

4 / 14

4. Which of the following is true about Python's garbage collector?

5 / 14

5. What will be the output of the following code?
import threading

def print_numbers():
for i in range(5):
print(i)

t1 = threading.Thread(target=print_numbers)
t2 = threading.Thread(target=print_numbers)

t1.start()
t2.start()

t1.join()
t2.join()

6 / 14

6. What will be the output of the following code?
import unittest

class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')

if __name__ == '__main__':
unittest.main()

7 / 14

7. What will be the output of the following code?
import re

pattern = re.compile(r'(\d{3})-(\d{2})-(\d{4})')
match = pattern.match('123-45-6789')
print(match.groups())

8 / 14

8. Which module is used for asynchronous programming in Python?

9 / 14

9. Which module is used for debugging in Python?

10 / 14

10. What will be the output of the following code?
import re

pattern = re.compile(r'\d+')
result = pattern.sub('#', 'My number is 123 and my friend's number is 456')
print(result)

11 / 14

11. Which method is used to replace all occurrences of a pattern in a string?

12 / 14

12. What is the output of the following code?
from collections import deque

d = deque([1, 2, 3, 4])
d.appendleft(0)
d.pop()
d.extend([5, 6])
d.rotate(1)
print(d)

13 / 14

13. What is the purpose of the __slots__ attribute in a Python class?

14 / 14

14. Which module is used for JSON manipulation in Python?

Your score is

0%