Computer Science, asked by astergaming67, 3 months ago

Which is a valid Identifier
1. My.School
2. MYSchool
3. My School
4. My-School​

Answers

Answered by Equestriadash
8

2. MYSchool is a valid identifier.

Identifiers are names used to store values/used as variables/functions/a name given to identify a variable. They can consist of letters, followed by numbers and cannot have a special character other than an underscore (_).

  • 1. My.School is invalid since it has a special character [fullstop].
  • 3. My School is invalid since it has a special character [space].
  • 4. My-School is invalid since it has a special character [hyphen].

Since MYSchool doesn't have special characters/does not start with a number, it is a valid identifier.

Keywords such as if, elif, class, def, dict, ... etc, cannot be classified as an identifier.


Equestriadash: Thanks for the Brainliest! ^_^"
Similar questions