Q:6. Which of the following is used for performing repetitive tasks in Python?
1.
2.
3.
4.
ANSWER :- (4) loops are used for performing repetitive tasks in python, with the help of loops we can reduce a long series of repetitive instructions down to one instruction .
Q:7. How is a line, or a group of lines, related to the rest of the python program?
1.
2.
3.
4.
ANSWER :- (2) indentation refers to the spaces at the beginning of a code line Python uses indentation to indicate a block of code. and relate a line to entire program. while other languages uses braces to define block of codes.
Q:8. If numbers=[1, 2, 3, 4, 5] , then how to get the largest value of this list?
1.
2.
3.
4.
ANSWER :- (2) In Python max() function returns the largest item in an iterable. It can also be used to find the largest item between two or more parameters.
Q:10. Which of the following is a valid singleton tuple?
1.
2.
3.
4.
A tuple of one item can be formed by affixing a comma to an expression. an expression by itself does not create a tuple, since parentheses must be usable for grouping of expressions. thus single=1, is correct one.
Thanks for help to complete quiz with correct answers and best reasons..
ReplyDelete