Page 79 - 2501_KVS_C-8
P. 79
C. Predict/Select the correct OUTPUT for each question.
1. B. 2. A. 3. A. 4. A. 5. A.
D. State whether these statements are true or false.
1. False 2. False 3. True 4. False 5. False
Check Your Knowledge (pg. 42)
Do it yourself.
A. Answer the following questions:
1. ‘range()’ is a function that is used to generate a sequence of values from a lower-
limit to one less than upper-limit number. It only works on integers. E.g. range(1,5)
will give (1, 2, 3, 4) output.
2. Lower-limit is the value from which a range() function starts generating numbers.
Upper-limit is one less than the value up to which a range() function will generate
the numbers. E.g. in range(1,5), lower-limit is 1 and upper-limit is 5.
3. Skip value is the step or increment value which is to be added in the previous value
to generate the next value.
E.g. In range(1, 10, 2) statement, 2 is the skip value which will be added to every
previous value and give the following result (1, 3, 5, 7, 9).
4. Yes. range(10, 0, -1).
B. Fill in the blanks.
1. Skip
2. Upper-limit
3. Lower-limit
4. 1 4 7.
C. Predict/Select the correct OUTPUT for each question.
1. B. 2. C. 3. C. 4. A. 5. A.
D. State whether these statements are true or false.
1. True 2. False 3. False 4. False 5. False
APPENDIX (Answers) 77

