Assessment Exam 2:
a) “””this is a valid comment line”””
b) “”this is a valid comment line””
c) #this is a valid comment line
d) All of the above
Next: Data types
1. Is Python case sensitive when
dealing with identifiers?
a) yes
b) no
c) machine dependent
d) none of the mentioned
a) yes
b) no
c) machine dependent
d) none of the mentioned
2. What is the maximum possible
length of an identifier?
a) 31 characters
b) 63 characters
c) 79 characters
d) none of the mentioned
a) 31 characters
b) 63 characters
c) 79 characters
d) none of the mentioned
3. Which of the following is
invalid?
a) _a = 1
b) __a = 1
c) __str__ = 1
d) none of the mentioned
a) _a = 1
b) __a = 1
c) __str__ = 1
d) none of the mentioned
4. Which of the following is an
invalid variable?
a) my_string_1
b) 1st_string
c) raj
d) _123
a) my_string_1
b) 1st_string
c) raj
d) _123
5. What is object reference in
Python?
a) Which is used to refer to the object (data)
b) It is a data type
c) which holds the data
d) None of the above
a) Which is used to refer to the object (data)
b) It is a data type
c) which holds the data
d) None of the above
6. Which of the following is not a
keyword?
a) eval
b) assert
c) nonlocal
d) for
a) eval
b) assert
c) nonlocal
d) for
7. All keywords in Python are in
a) lower case
b) UPPER CASE
c) Capitalized
d) None of the mentioned
b) UPPER CASE
c) Capitalized
d) None of the mentioned
8. Which of the following is true for
variable names in Python?
a) unlimited length
b) all private members must have leading and trailing underscores
c) underscore and ampersand are the only two special characters allowed
d) none of the mentioned
a) unlimited length
b) all private members must have leading and trailing underscores
c) underscore and ampersand are the only two special characters allowed
d) none of the mentioned
9. Which of the following is an
invalid statement?
a) abc = 1,000,000
b) a b c = 1000 2000 3000
c) a,b,c = 1000, 2000, 3000
d) a_b_c = 1,000,000
10. How to write multiple comment lines in Pythona) abc = 1,000,000
b) a b c = 1000 2000 3000
c) a,b,c = 1000, 2000, 3000
d) a_b_c = 1,000,000
a) “””this is a valid comment line”””
b) “”this is a valid comment line””
c) #this is a valid comment line
d) All of the above
Next: Data types
No comments:
Post a Comment