State with reasons why are the following variable names invalid;
1) For
2) book list
3) 2ndTerm
4) hash#
Answers
1) FOR: As a rule a variable should not be a keyword, as 'for' is a keyword it is invalid
2) book list: As a rule no spaces should be used while writing variable. The name 'book list' contains space so it is invalid.
3) 2ndTerm: As a rule a variable must not begin with a digit that's why it is invalid.
4) hash#: As a rule no special character such as +,-,×,÷,#,etc cannot be used. so, hash# is invalid.
ÅŃŠWĘŘ
1) FOR: As a rule a variable should not be a keyword, as 'for' is a keyword it is invalid
2) book list: As a rule no spaces should be used while writing variable. The name 'book list' contains space so it is invalid.
3) 2ndTerm: As a rule a variable must not begin with a digit that's why it is invalid.
4) hash#: As a rule no special character such as +,-,×,÷,#,etc cannot be used. so, hash# is invalid.