a) eval b) nonlocal c) pass d) assert Answer: a Explanation: eval can be used as a variable.
View QuestionIs Python case sensitive when dealing with identifiers?
a) machine dependent b) yes c) no d) none of the above Answer: b Explanation: Case is always significant.
View QuestionMathematical operations can be performed on a string.
a) True b) False Answer: b Explanation: You can’t perform mathematical operation on string even if the ...
View QuestionWhich of the following is true for variable names in Python?
a) unlimited length b) underscore and ampersand are the only two special characters allowed c) all private members must ...
View QuestionWhich of the following is invalid?
a) _a = 1 b) __str__ = 1 c) __a = 1 d) none of the above Answer: d
View QuestionWhich one of the following has the highest precedence in the expression?
a) Addition b) Multiplication c) Parenthesis d) Exponential Answer: c Explanation: PEMDAS, i.e , Parenthesis, Exponentiation, Division, ...
View QuestionWhy are local variable names beginning with an underscore discouraged?
a) they are used to indicate a private variables of a class b) they are used to indicate ...
View QuestionWhich of the following is an invalid statement?
a) abc = 1,000,000 b) a_b_c = 1,000,000 c) a b c = 1000 2000 3000 d) a,b,c = 1000, ...
View QuestionWhich of the following is an invalid variable?
a) foo b) 1st_string c) my_string_1 d) _ Answer: b Explanation: Variable names should not start with a number.
View QuestionAll keywords in Python are in _________
a) lower case b) Capitalized c) UPPER CASE d) None of the above Answer: d Explanation: True, ...
View Question