Write 5 examples of Valid and invalid Identifiers in python.
Answers
Hey dear ‼️
Answer....
Variables are examples of identifiers. Identifiers are names given to identify something. There are some rules you have to follow for naming identifiers:
The first character of the identifier must be a letter of the alphabet (upper or lowercase) or an underscore ('_').
The rest of the identifier name can consist of letters (upper or lowercase), underscores ('_') or digits (0-9).
Identifier names are case-sensitive. For example, myname and myName are not the same. Note the lowercase n in the former and the uppercase N in te latter.
Examples of valid identifier names are i, __my_name, name_23 and a1b2_c3.
Examples of invalid identifier names are 2things, this is spaced out and my-name.
keep loving....❤️❤️❤️❤️❤️❤️✌️
Interesting Question!! ✌
_________________________________________
Answer➡
An Identifier is basically a name which is given to identify the functions, classes and variables etc.
Five Examples of Valid identifiers in Python are -
⭐. Your_class
⭐.Your_Roll no.
⭐. mp_3
⭐. Class_no.
⭐.Phone_No
Five Examples of Invalid Identifiers in Python -
⭐. School- name
⭐. Roll-No.
⭐. Basic - rules
⭐. My - name
⭐. Class - no.
_______________________________________
THANKS ;) ❤
BE
BRAINLY
✌✌