Site icon CBSECS

Tokens in Python

Tokens in Python

Python Tokens & Variables Quiz | cbsecs.in

Python Tokens & Variables Quiz

Character Sets | Tokens | L-value & R-value | Comments

1. Which character set does Python use by default?
  • ASCII only
  • Unicode
  • EBCDIC
2. What are ‘Punctuators’ in Python?
  • Words with special meaning
  • Symbols used to organize sentence structure (e.g., [], {}, ,)
  • Variables that store numbers
3. In the statement X = 10, which is the ‘L-value’?
  • X
  • 10
  • =
4. Which symbol is used for writing a single-line comment in Python?
  • //
  • /*
  • #
5. What happens when you try to assign a value to an R-value, like 10 = X?
  • It works perfectly
  • SyntaxError: cannot assign to literal
  • It creates a variable named 10
6. A named memory location that stores data is called a:
  • Constant
  • Variable
  • Keyword
7. Multiline comments (docstrings) are often enclosed in:
  • Triple quotes (”’ or “””)
  • Square brackets []
  • Curly braces {}
8. Which of these is NOT a Python token?
  • Identifier
  • Operator
  • Memory Address
9. What is the value of a after: a = 5; b = a; a = a + 2?
  • 5
  • 7
  • 2
10. In Python, variables are created:
  • When they are declared without a value
  • The moment you first assign a value to them
  • Only at the start of the program
CERTIFICATE OF ACHIEVEMENT

This award is presented to

Student Name

for completing the Python Tokens & Variables Assessment

Score: 0 / 10

Exit mobile version