Q. Find the invalid identifier from the following:
a) MyName b) True c) 2ndName d) My_Name e)true f)None
Ans : b) True c) 2ndName f)None
Q. Find the valid identifier from the following
(a) Total_ (b) TRUE (c) 4thdata (d) break
Ans: (a)
Q. Find the invalid identifier from the following
a) _No_of_teacher b) true c) Address d) continue
Ans: (d)
Q. Which of the following is an invalid variable?
a) my_string_1 b) 1st_string c) foo d) _
Ans: (b)
Q. Python Identifiers are case sensitive?
TRUE/FALSE
Ans: TRUE
Q.Identify the valid identifier from the following
(a)x+y (b) xy2xy (c)x2y2x (d)_x_y
Ans: (c)(d)
Q. Write the type of tokens from the following:
(i) if (ii) roll_no (iii) >= (iv) “hello” (v) **
Ans:
(i) keyword (ii) identifier (iii) relational operator (iv) string (v) arithmetic operator