LogoLearning For Everyone
Take Quiz
Contact Us
Related Topics
Related Topics
Selected Topic: All
1. Is Python case sensitive when dealing with identifiers?
Choose the correct option:
  • a) yes

  • b) no

  • c) machine dependent

  • d) none of the mentioned

Case is always significant while dealing with identifiers in python.

2. What is the maximum possible length of an identifier?
Choose the correct option:
  • a) 31 characters

  • b) 63 characters

  • c) 79 characters

  • d) none of the mentioned

Identifiers can be of any length.

3. Which of the following is invalid?
Choose the correct option:
  • a) _a = 1

  • b) __a = 1

  • c) __str__ = 1

  • d) none of the mentioned

All the statements will execute successfully but at the cost of reduced readability.

4. Which of the following is an invalid variable?
Choose the correct option:
  • a) my_string_1

  • b) 1st_string

  • c) foo

  • d) _

Variable names should not start with a number.

5. Why are local variable names beginning with an underscore discouraged?
Choose the correct option:
  • a) they are used to indicate a private variables of a class

  • b) they confuse the interpreter

  • c) they are used to indicate global variables

  • d) they slow down execution

As Python has no concept of private variables, leading underscores are used to indicate variables that must not be accessed from outside the class.

Items per page: