Answer:
def printRange(start, stop, steps = 1):
list1 = []
if steps > start or stop:
print("Steps is larger than start and stop value")
return None
if int(start) < int(stop):
while start < stop:
start = start + int(steps)
list1.append(start)
print(list1)
elif start > stop:
while start > stop:
stop = stop + int(steps)
list1.append(stop)
print(list1)
elif start == stop:
print(start)
else:
print("Values are not integers.")
for easier viewing:
https://www.codepile.net/pile/e95verLk
If you need help understanding comment below.
Answer:
The answer is "Option a"
Explanation:
Range-based for loop performs a sequence for a loop. It's more accessible as the conventional loop, for example, all components in the array, running more than a range of possibilities. In the given question "option a" is correct because it follows the correct syntax and other choices were wrong, which can be described as follows:
- In option b, It's not correct, because in this code the range declaration is wrong.
- In option c, It is wrong, because in this code the datatype is missing.
- In option d, It is illegal syntax, that's why it is wrong.
Whenever the VM does not need to be access at a known address by other network nodes.
Explanation:
10:A program that assigns the sum 20,30,40
20: input 20,30,40
30:sum input
40: print total
End