Python MCQs Test 1 Fill in your details and start your exam now! NameEmailPhone Number 1 / 20 What is the output of the following code? \nprint(10 % 3) 1 2 3 0 2 / 20 How do you import a module named mymodule in Python? import mymodule include mymodule import module:mymodule from mymodule import * 3 / 20 What does the strip() method do in Python? Removes leading and trailing whitespaces Removes all occurrences of a specified character Splits a string into a list Converts the string to uppercase 4 / 20 Which of the following is NOT a valid way to comment in Python? // This is a comment # This is a comment ''' This is a comment ''' /* This is a comment */ 5 / 20 What is the output of the following code? \nprint("Hello" + "World") HelloWorld Hello World Hello+World Error 6 / 20 What does the break statement do in a loop? Exits the loop entirely Skips the current iteration and continues with the next one Pauses the loop temporarily None of the above 7 / 20 Which of the following data types is mutable in Python? Tuple List Set String 8 / 20 What is the result of the expression 3 ** 2 in Python? 6 9 27 81 9 / 20 Which of the following is NOT a valid variable name in Python? _my_var myVar 1stVar my_var_2 10 / 20 What is the output of the following code? \nprint(2 + 2 * 3 - 2 / 2) 5 6 7 8 11 / 20 What library is commonly used for data visualization in Python? Matplotlib Requests Seaborn Django 12 / 20 Which library is used for creating web scrapers in Python? BeautifulSoup Numpy TensorFlow Scrapy 13 / 20 What library is commonly used for data analysis in Python? Pandas Numpy TensorFlow Pytorch 14 / 20 What is the output of the following code? \nprint("Python"[::-1]) Python nohtyP p n 15 / 20 What does the len() function do in Python? Returns the length of a list, tuple, or string Returns the largest element of a list Returns the smallest element of a list Returns the sum of all elements in a list 16 / 20 What library is commonly used for web development in Python? Flask TensorFlow Matplotlib Django 17 / 20 Which library is commonly used for working with arrays in Python? Numpy Requests TensorFlow Matplotlib 18 / 20 What library is used for asynchronous programming in Python? Asyncio Numpy Pandas Flask 19 / 20 Which library is commonly used for data manipulation and analysis in Python? Pandas TensorFlow Flask Django 20 / 20 What library is used for handling HTTP requests in Python? Requests Flask Pygame Matplotlib Your score isThe average score is 0% 0% Restart Your Test