CBSE Class 11 Informatics Practices Question 25 of 102

Python Programming Fundamentals — Question 2

Back to all questions
2
Question

Question 2

Identifier name cannot be composed of special characters other than ............... .

  1. #
  2. Hyphen (-)
  3. $\text{\textdollar}
  4. Underscore (_)
Answer

Underscore (_)

Reason — In Python, an identifier name can only be composed of letters (both uppercase and lowercase), digits, and underscores (_). Special characters like #, hyphen (-), and $\text{\textdollar} are not allowed in identifier names.