Which one is NOT a legal variable name?
1 point
A)_myvar
B)my-var
C)MyVar
D)My_Var
Answers
Answered by
18
Answer:
Myvar is not legal variable name
Answered by
2
"Option B: my-var is not a legal variable name".
Variable name:
In python, a variable name must start with an alphabetic or the underscore character. Variable names in python cannot start with a digit. Variable names in Python can have any length and also consist of uppercase and lowercase in names.
Python variable name consists of an alphabetic letter, underscores, number, and only. For example, myVar, MyVar, _myVar, MyVar123 are the valid variable names in python, but m*var, my-var, and 1myVar are invalid variable names in python.
Similar questions
Science,
6 months ago
Social Sciences,
6 months ago
Computer Science,
6 months ago
History,
1 year ago
English,
1 year ago
English,
1 year ago
Science,
1 year ago