What list of values is created by the following code?
list ( range ( 10, 30, 5 ) )
select one:
a | [5, 10, 15, 20, 25, 30] |
b | [10, 20, 30] |
c | [10, 15, 20, 25, 30] |
d | [10, 15, 20, 25] |
e | [10, 50] |
list(range(10,30,5)) will create [10,15,20,25].
range(start,end,step) is the syntax of the range method.
Example Explanation:
start =10 , end=30 , step=5
10 will be included, then 10+5 =15, 15+5 =20 ,20+5 =25 , 25+5=30 > stop-1. So 30 will not be included in the list.
So, final answer is [10,15,20,25].
Get Answers For Free
Most questions answered within 1 hours.