This document contains a quiz on Python fundamentals with 44 multiple choice questions covering topics like:
- Python identifiers and tokens
- Literals and data types
- Operators and expressions
- Comments and indentation
- Functions and return values
- Strings and lists
- List indexing, slicing and built-in methods.
The questions test concepts like identifier naming rules, numeric and string literals, operator precedence, basic arithmetic expressions, string and list indexing/slicing, built-in functions like len(), append(), extend(), del etc. and their output.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100%(1)100% found this document useful (1 vote)
2K views5 pages
Class 12 CS Revision Tour MCQ
This document contains a quiz on Python fundamentals with 44 multiple choice questions covering topics like:
- Python identifiers and tokens
- Literals and data types
- Operators and expressions
- Comments and indentation
- Functions and return values
- Strings and lists
- List indexing, slicing and built-in methods.
The questions test concepts like identifier naming rules, numeric and string literals, operator precedence, basic arithmetic expressions, string and list indexing/slicing, built-in functions like len(), append(), extend(), del etc. and their output.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
MCQs Chapter 1 Python Revision Tour
1. Python identifiers are case sensitive.
a) True b) False c) Depends on Program d) Depends on the computer system 2. Which of the following is an invalid identifier? a) CS_class_XII b) csclass12 c) _csclass12 d) 12CS 3. The tiny individual unit in python program is known as ___________ a) Expression b) Statement c) Token d) Comment 4. Which of the following not a token? a) Comments b) Identifiers c) Literals d) Operators 5. Which of the following are pre-defined or reserved words that convey a special meaning in programming language? a) Identifiers b) Literals c) Keywords d) Operators 6. The different names given to different parts of a program is known as _________ a) Identifiers b) Literals c) Keywords d) Operators 7. Which of the following literals must terminate in one line? a) Single line Strings b) Multi line strings c) Numeric Literals d) All of the above 8. To include non-graphic characters in python, which of the following is used? a) Special Literals b) Boolean Literals c) Escape Character Sequence d) Special Literal – None 9. The octal literal and hexadecimal literals start with which of the following symbols resepctively? a) O0 and X0 b) 0O and 0X c) Oct0 and Hex0 d) 0o and 0x 10. Which of the following literal has either True or False value? a) Special Literals b) Boolean Literals c) Numeric Literals d) String Literals 11. Which of the following are symbols used for computation or logical comparison in a program? a) Identifiers b) Literals c) Keywords d) Operators 12. Which of the following is correct statement to computer square of variable x in python? a) x * 2 b) x power 2 c) x ** 2 d) x // 2 13. If you want to display the values without decimal place after division, which of the following symbol is used? a) / b) // c) % d) ** 14. Which of the is a correct statement? a) xyz = 10 100 1000 b) x y z = 10 100 1000 c) x, y, z = 10, 100, 1000 d) x y z= 10, 100, 1000 15. Which of the following are symbols used in programming languages to organize statement structures and indicate the rhythm of the program? a) Operators b) Punctuators c) Functions d) Literals 16. In python, the single line comments starts with _______ a) / b) // c) # d) ”’ 17. In python, the multiline comments starts with ________ a) / b) // c) # d) ”’ 18. _______ are additional readable information to clarify the statement in python. a) Comments b) Expressions c) Tokens d) Flow of control 19. Which of the following is a group of statements which are part of another statement or functions? a) Expression b) Statement c) Block d) Comment 20. All statements inside a block are indented at same level. a) True b) False c) Not necessarily d) Depends on user’s choice 21. By default the input() function returns a) Integer b) Float c) Boolean d) String 22. If a function does not return a value then what value will be returned by python in a function? a) int b) void c) bool d) none 23. The output of d= a + b % c is _________, if a = 12, b=5 and c=3. a) 14 b) 2 c) 5 d) 17 24. Evaluate x % y // x, if x = 5, y = 4 a) 1.0 b) 0.0 c) 0 d) 1 25. Which of these arithmetic operator will evaluate first? a) + b) – c) ** d) % e) // 26. Which of these relational operator has highest operator precedence? a) < b) >= c) <= d) == 27. Which of the following logical operator will evaluate first? a) and b) or c) not d) is not 28. How a>b>c will be interpreted by python? a) a>b or a>c b) a>b not a>c c) a>b and a>c d) a>b && a>c 29. Which of the following statement is correct for and operator? a) Python only evaluates the second argument if the first one is False b) Python only evaluates the second argument if the first one is True c) Python only evaluates True if any one argument is True d) Python only evaluates False if any one argument is False 30. Which of the following forces an expression to be converted into specific type? a) implicit type casting b) mutable type casting c) immutable type casting d) explicit type casting 31. _____ are stored as individual characters in contiguous locations, with two-way index for each location. a) lists b) tuples c) strings d) dictionaries 32. What is the output of – “5” + “5”? a) 25 b) 55 c) 10 d) error 33. If n=”Hello” and user wants to assign n[0]=’F’ what will be the result? a) It will replace the first character b) It’s not allowed in Python to assign a value to individual character using index c) It will replace the entire word Hello into F d) It will remove H and keep rest of the characters 34. Which of the following operator can be used as replication operator? a) + b) * c) ** d) / 35. Which point can be considered as difference between string and list? a) Length b) Indexing and Slicing c) Mutability d) Accessing individual elements 36. In list slicing, the start and stop can be given beyond limits. If it is then a) raise exception Index Error b) raise exception Value Error c) return elements falling between specified start and stop values d) return the entire list 37. In list slicing negative index -1 refers to a) first element b) last element c) second last element d) second element 38. Which of the following operator cannot used with strings? a) == b) + c) * d) / 39. Ms. Hetvee is working on a string program. She wants to display last four characters of a string object named s. Which of the following is statement is true? a) s[4:] b) s[:4] c) s[-4:] d) s[:-4] 40. The append() method adds an element at a) first b) last c) specified index d) at any location 41. Which of the following statement is true for extend() method a) ads element at last b) ads multiple elements at last c) ads element at specified index d) ads elements at random index 42. The statement del l[1:3] do which of the following task? a) deletes elements 2 to 4 elements from the list b) deletes 2nd and 3rd element from the list c) deletes 1st and 3rd element from the list d) deletes 1st, 2nd and 3rd element from the list 43. If l=[11,22,33,44], then output of print(len(l)) will be a) 4 b) 3 c) 8 d) 6 44. Which of the following method is used to delete element from the list? a) del() b) delete() c) pop() d) All of these