Which of the following identifier names are invalid and why? a) Serial_no. e) Total_Marksb) 1st_Room f) total-Marksc) Hundred$ g) _Percentaged) Total Marks h) True.
Answers
Answer:
hundreds gram is the right answer as gramage is not related with others
Answer:
ANSWER:
i) Serial_no.: Invalid - Identifier in python cannot contain any special character except underscore(_).
ii) 1st_Room: Invalid - Identifier in Python cannot start with a number.
iii) Hundred$: Invalid - Identifier in Python cannot contain any special character except underscore(_).
iv) Total Marks: Invalid - Identifier in Python cannot contain any special character except underscore(_). If more than one word is used as a variable then it can be separated using underscore ( _ ), instead of space.
v) Total_Marks: Valid
vi) total-Marks: Invalid - Identifier in Python cannot contain any special character except underscore(_). If more than one word is used as a variable then it can be separated using underscore ( _ ), instead of a hyphen ( - ).
vii) _Percentage: Valid
viii) True: Invalid - Identifier in Python should not be a reserved keyword