TN Online TestSamacheer Kalvi practice

12th Standard Computer Science — Python -Variables and Operators: Additional MCQs with Answers & Explanations

Share this chapter: Telegram

15 extra multiple-choice questions for Python -Variables and Operators (12th Standard Computer Science, Samacheer Kalvi), beyond the ones printed in the textbook — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.

Answer key at a glance

Q1
Which of the following is an invalid identifier in Python because it contains an illegal punctuation character?
  • A. total_marks
  • B. num1
  • C. name\$Correct
  • D. _Sum
Explanation. According to Python identifier rules, punctuation characters such as % or \$ are not allowed inside identifiers.
Q2
In Python, which of the following operators is used for performing floor division?
  • A. /
  • B. %
  • C. //Correct
  • D. **
Explanation. The floor division operator (//) performs integer division and returns the quotient as an integer value after discarding the fractional part.
Q3
Which built-in function is used to explicitly convert a string input containing a numerical value into an integer in Python?
  • A. str()
  • B. float()
  • C. int()Correct
  • D. input()
Explanation. The int() function is used to convert string data representing a number into integer data explicitly, since the input() function accepts all data as strings by default.
Q4
How does the Python interpreter treat lines that begin with the hash symbol (#)?
  • A. They are executed as high-priority commands.
  • B. They are treated as comments and ignored by the interpreter.Correct
  • C. They are used to define block structures instead of indentation.
  • D. They are flagged as syntax errors during execution.
Explanation. In Python, comments begin with the hash symbol (#) and are ignored by the interpreter during execution.
Q5
In Python, what character sequence is used to enclose multiline comments?
  • A. //
  • B. #
  • C. ''' (triple quotes)Correct
  • D. /* and */
Explanation. Multiline comments in Python should be enclosed within a set of triple quotes (''' ''').
Q6
Which of the following escape sequences is used to represent a carriage return in Python strings?
  • A. \\n
  • B. \\t
  • C. \\rCorrect
  • D. \\\\
Explanation. In Python strings, the escape sequence '\r' represents a carriage return, while '\n' is for newline and '\t' is for tab.
Q7
Which number representation is denoted by prefixing an integer with the digit 0 followed by the letter 'o' (such as 0o102) in Python?
  • A. Binary integer
  • B. Octal integerCorrect
  • C. Hexadecimal integer
  • D. Long decimal integer
Explanation. In Python, octal integers are represented by using the digit 0 followed by the lowercase letter 'o'.
Q8
What is the correct syntax for the conditional (ternary) operator in Python?
  • A. Variable Name = [Test expression] ? [on_true] : [on_false]
  • B. Variable Name = [on_true] if [Test expression] else [on_false]Correct
  • C. Variable Name = if [Test expression] then [on_true] else [on_false]
  • D. Variable Name = [on_true] else [on_false] if [Test expression]
Explanation. The conditional (ternary) operator syntax in Python is: Variable Name = [on_true] if [Test expression] else [on_false].
Q9
Given the variable values a = 97 and b = 35, what will be the result of the logical expression: not a > b in Python?
  • A. True
  • B. FalseCorrect
  • C. None
  • D. SyntaxError
Explanation. Since a (97) is greater than b (35), the expression a > b evaluates to True. Applying the 'not' operator negates True to False.
Q10
Python identifiers are case-sensitive. Which of the following is true regarding two identifiers named Sum and sum?
  • A. They are treated as identical by the interpreter.
  • B. They are recognized as two distinct, different identifiers.Correct
  • C. They will cause a compilation error if used in the same program.
  • D. The interpreter automatically converts Sum to lowercase sum.
Explanation. Python identifiers are case-sensitive, meaning that uppercase and lowercase letters are treated as distinct, so Sum and sum are different identifiers.
Q11
Which of the following is a valid example of exponent data representation for floating-point numbers in Python?
  • A. 12.E04Correct
  • B. 12L
  • C. 0o12
  • D. 0X12
Explanation. In Python, floating-point exponent data contains a decimal digit part, a decimal point, and an exponent part followed by one or more digits, such as 12.E04.
Q12
Which of the following characters is NOT used as a delimiter in Python expressions, lists, dictionaries, or strings?
  • A. :
  • B. ;
  • C. \$Correct
  • D. ,
Explanation. In Python, delimiters include characters like parentheses, brackets, braces, commas, colons, and semicolons, but symbols like '\$' are not used as delimiters.
Q13
When using Python IDLE in interactive mode, what will be the output of evaluating the expression 5 ** 2?
  • A. 10
  • B. 25Correct
  • C. 2.5
  • D. 50
Explanation. The double asterisk (**) is the exponentiation operator in Python, so evaluating 5 ** 2 yields 25.
Q14
Which of the following characters can a Python identifier legally begin with?
  • A. Only lowercase alphabets
  • B. Only uppercase alphabets
  • C. An alphabet (A..Z or a..z) or an underscore (_)Correct
  • D. Any alphanumeric character including digits
Explanation. A Python identifier must start with either an alphabet letter (A..Z or a..z) or an underscore (_).
Q15
If the initial value of x is 10, what will be the value of x after executing the compound assignment statement x += 20?
  • A. 10
  • B. 20
  • C. 30Correct
  • D. 200
Explanation. The statement x += 20 is equivalent to x = x + 20, which adds 20 to the initial value of 10, resulting in 30.
Take the Additional practice test → Open the app

More for this chapter

Book Back Questions10 textbook MCQs · solved Practice TestInteractive · instant score Book Back TestTest yourself on the textbook set Additional MCQ TestTest yourself on the extra set Study NotesConcepts & methods Formula SheetAll key formulas

About these Python -Variables and Operators questions

These are the Additional multiple-choice questions for Python -Variables and Operators from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Science syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.

Frequently asked questions

How many MCQs are there in Python -Variables and Operators?

This chapter has 15 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.

Are these 12th Standard Computer Science MCQs free to practise online?

Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.

Where can I find the Python -Variables and Operators book-back answers?

The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.

More chapters in Computer Science

View all
1 Function 2 Data Abstraction 3 Scoping 4 Algorithmic Strategies 6 Control Structures 7 Python functions 8 Strings and String manipulation 9 Lists, Tuples, Sets and Dictionary 10 Python Classes and objects 11 Database Concepts 12 Structured Query Language (SQL) 13 Python and CSV files 14 Importing C++ programs in Python. 15 Data manipulation through SQL 16 Data visualization using pyplot: line chart, pie chart and bar chart