Q. Give three examples of legal variable names and two examples of illegal variable names in Python. For the illegal variable names explain why they are illegal. Do not use one-letter variable names.
Legal Names
(i)
(ii)
(iii)
Illegal Names
(i)
(ii)
Answer :-
Legal Names
(i) MyFile
(ii) Val_23
(iii) _Python2
Illegal Names
(i) Py-code
Explanation :- Contains special character.
(ii) is
Explanation :- Reserved keyword
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )