Python Language Quiz

In this Python Language Quiz Section - Every Question carries 2 Marks. If any Question/Answer will be wrong then 2 Marks will be deducted.

Note : - Fill information correctly to get Certified.

Python Quiz

1 / 50

Choose the correct syntax for reading from a text file stored in ‘‘c:\scores.txt'' ?

2 / 50

Which of the following is a correct way to comment multiple lines in Python?

3 / 50

In Python, which of the following data types is immutable?

4 / 50

Which of the following is used to get user input in Python?

5 / 50

Which keyword is used to define a function in Python?

6 / 50

Which of the following statements is true about Python?

7 / 50

Which of the following is used to open a file in Python?

8 / 50

Which of the following is not a valid data type in Python?

9 / 50

Which of the following is the correct way to check if two variables refer to the same object in memory?

10 / 50

Which of the following is used to remove the last element from a list in Python?

11 / 50

Which of the following is the correct way to define a tuple in Python?

12 / 50

Which of the following is used to concatenate two strings in Python?

13 / 50

Which of the following is the correct way to declare a list in Python?

14 / 50

Which of the following is a correct way to define a dictionary in Python?

15 / 50

Which of the following is the correct way to access the value associated with a key in a dictionary?

16 / 50

Which of the following is a correct way to check if a key exists in a dictionary?

17 / 50

Which of the following is used to remove an element from a set in Python?

18 / 50

Which of the following is used to remove the first occurrence of a value from a list in Python?

19 / 50

Which of the following is the correct way to define a set in Python?

20 / 50

Which of the following is the correct way to remove an item from a dictionary in Python?

21 / 50

Which of the following is the correct way to concatenate two lists in Python?

22 / 50

Which of the following is used to convert a string to uppercase in Python?

23 / 50

Which of the following is used to convert a string to lowercase in Python?

24 / 50

Which of the following is used to split a string into a list in Python?

25 / 50

Which of the following is used to find the length of a string in Python?

26 / 50

Which of the following operators is used for exponentiation in Python?

27 / 50

Which of the following statements is used to exit from a loop in Python?

28 / 50

Which of the following is the correct way to define a function in Python with parameters?

29 / 50

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

30 / 50

Which of the following is the correct way to check if a string contains a substring in Python?

31 / 50

Which of the following is the correct way to create an empty set in Python?

32 / 50

Which of the following methods is used to remove an arbitrary item from a set in Python?

33 / 50

Which of the following is the correct way to create a tuple with a single element in Python?

34 / 50

Which of the following is the correct way to access the last element of a list in Python?

35 / 50

Which of the following methods is used to join elements of a list into a single string in Python?

36 / 50

Which of the following is the correct way to add a key-value pair to a dictionary in Python?

37 / 50

Which of the following is used to repeat a string in Python?

38 / 50

Which of the following is the correct way to convert a string to a list of characters in Python?

39 / 50

Which of the following is the correct way to iterate over a dictionary in Python?

40 / 50

Which of the following methods is used to remove an item from a list by its index in Python?

41 / 50

Which of the following is the correct way to access the first element of a tuple in Python?

42 / 50

Which of the following is the correct way to concatenate two dictionaries in Python 3.5+?

43 / 50

Which of the following methods is used to convert a list to a set in Python?

44 / 50

Which of the following methods is used to sort elements of a list in Python?

45 / 50

What command is used to insert 6 in a list ‘‘L'' at 3rd position ?

46 / 50

Which of the following is false statement in python

47 / 50

 

What is output for −

' ' in 'python' ?

48 / 50

Which of the following is not correct about the Serialization?

49 / 50

Which of the following is not an argument of the dumps function?

50 / 50

Which of the following are not the constants in the Pickle module?

Your score is

The average score is 66%

0%

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top