Quiz Assessment

Create an engaging and colorful illustration of a Python programming environment, featuring a quiz interface with code snippets, Python logos, and icons representing various programming concepts like dictionaries, tuples, and file handling.

Master Python: Test Your Knowledge!

Welcome to the ultimate Python quiz designed for enthusiasts and learners alike! This quiz covers a variety of fundamental concepts and challenges your understanding of Python programming. Whether you're a beginner or an experienced coder, you'll find this engaging and educational.

Test your knowledge on:

  • Dictionaries and Tuples
  • File handling modes
  • Data types and operators
  • Input functions
25 Questions6 MinutesCreated by CodingNinja324
1. Which of the following are true of Python dictionaries:
Dictionaries are accessed by key.
Dictionaries can be nested to any depth.
All the keys in a dictionary must be of the same type.
A dictionary can contain any object type except another dictionary.
Items are accessed by their position in a dictionary.
Dictionaries are mutable.
2. Which operator is right-associative
*
+
=
%
3. Suppose you are given a set (s1={1,2,3}) then what is the output for the code − 2 * s1?
(1,1,2,2,3,3)
[1,1,2,2,3,3]
(1,2,3,1,2,3)
Illegal
4. Which function can be used on the file to display a dialog for saving a file?
Filename = savefilename()
Filename = asksavefilename()
Fielname = asksaveasfilename()
No such option in python.
5. In Python 3, what is the type of type(range(5))
int
list
range
6. What is the result of print(type({}) is set)?
True
False
7. What is the result of print(type([]) is list)?
True
False
8. Select the right way to create a string literal Ault'Kelly
Str1 = ‘Ault\\’Kelly’
Str1 = ‘Ault\’Kelly’
Str1 = ‘Ault \’Kelly’
Str1 = “””Ault’Kelly”””
9. What is the data type of print(type(10))?
Int
Integer
Number
Float
10. What is the data type of print(type(0xFF))
Number
Hexint
Hex
Int
11. What is the output of the following code? print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))
False True False True
True True False True
True True False True
False True True True
12. Select true statements regarding the Python tuple
We can remove the item from tuple but we cannot update items of the tuple
We cannot delete the tuple
We cannot remove the items from the tuple
We cannot update items of the tuple.
13. A Python tuple can also be created without using parentheses
True
False
14. Select which is true for Python tuple
A tuple maintains the order of items
We cannot change the tuple once created
A tuple is unordered
We can change the tuple once created
15. Choose the correct way to access value 20 from the following tuple? aTuple = ("Orange", [10, 20, 30], (5, 15, 25))
ATuple[1:2][1]
ATuple[1:2](1)
ATuple[1:2][1]
ATuple[1][1]
16. Choose the correct function to get the character from ASCII number
Ascii(‘number)
Chr(number)
Char(number)
17. Strings are immutable in Python, which means a string cannot be modified.
True
False
18. Choose the correct function to get the ASCII code of a character
Char(‘char’)
Ord(‘char’)
Ascii(‘char’)
19. What is the output of print('[%c]' % 65)
65
A
[A]
Syntax Error
20. What is true for file mode ?
Create a file if the specified file does not exist
Create a file, returns an error if the file exists
Create a file if it doesn’t exists else Truncate the existed file
All the above
21. Which of the following is incorrect file handling mode in Python?
R
X
B
T+
22. In Python3, Whatever you enter as input, the input() function converts it into a string
False
True
23. Which of the following is incorrect file handling mode in Python?
Wb+
Ab
Xr
Ab+
24. In Python3, which functions are used to accept input from the user
Input()
Raw_input()
Rawinput()
String()
25. What is the output of the following print() function? print('%d %d %.2f' % (11, '22', 11.22))
11 22 11.22
TypeError
11 ’22’ 11.22
{"name":"Quiz Assessment", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Welcome to the ultimate Python quiz designed for enthusiasts and learners alike! This quiz covers a variety of fundamental concepts and challenges your understanding of Python programming. Whether you're a beginner or an experienced coder, you'll find this engaging and educational.Test your knowledge on:Dictionaries and TuplesFile handling modesData types and operatorsInput functions","img":"https:/images/course8.png"}
Powered by: Quiz Maker