Which of the following is not considered a valid identifier in Python?
(a) two2
(b) _main
(c) hello_rsp1
(d) 5 hundred
Answers
Answered by
0
Answer:
d) 5 hundred
Explanation:
so ja raha tha n hmmm I am
Answered by
0
Answer:
The correct answer to the given question is:
d) 5 hundred
Explanation:
5 hundred is an invalid identifier because an identifier can't start with a number in Python.
Identifiers are names given to entities like classes, functions, variables, etc. It makes it possible to distinguish one entity from another.
Identifier writing rules:
- An identifier can be a combination of lowercase letters (a to z) or uppercase letters (A to Z) or numbers (0 to 9) or the underscore _. Names like myClass, var_1 and print_this_to_screen are all valid examples.
- The identifier cannot start with a number. 1variable is not valid, but variable1 is a valid name.
- The keyword cannot be used as an identifier.
- We cannot use special symbols like !, @, #, $,%, etc. in our identifier.
- An identifier can be of any length.
#SPJ3
Similar questions