Question-65: Which of the following is not a valid variable name?
- My Name="Amit Jain"
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- 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.