Question-65: Which of the following is not a valid variable name?

  1. My Name="Amit Jain"
  2. Get all Questions and Answer from here
  3. You need to have paid subscription to access all questions
  4. Thanks for considering Python Certification Material

 

Answer: A,B

Exp: Restrictions for variable name

  • Variable name can have upper- and lower-case letters.
  • Variable name can have digit in it
  • Variable name can have “_” underscore in it
  • Name of the variable must start with a letter.
  • Variable names are case sensitive
  • Variable name cannot be from reserved keyword by Python.

Valid Variable Names

myName="Amit Jain"

i=100

v100=100

Rate=10

counter=101

my_name_is="Amit Jain"

MyFirstAndSecondNameIsNotThatLong="Amit Jain"

_="Wow"

MYNAME="Avinash Dube"

 

 

print(myName)

print(i)

print(v100)

print(Rate)

print(counter)

print(my_name_is)

print(MyFirstAndSecondNameIsNotThatLong)

 

You can access to full explanation to question and answer from this page.

 

Why Dont you prepare for Python Certifications and Interview Questions with 250+ Questions and Answer : Check Here

Real Exam Number of Questions: 70 Questions
Real Exam Pass Score: 70%
Time Allotted: 90 minutes to complete exam