Computer Science
What values are generated when the function range(6, 0, -2) is executed ?
- [4, 2]
- [4, 2, 0]
- [6, 4, 2]
- [6, 4, 2, 0]
- [6, 4, 2, 0, -2]
Python Control Flow
34 Likes
Answer
[6, 4, 2]
Answered By
8 Likes
Related Questions
Consider the following code segment:
a = int(input("Enter an integer: ")) b = int(input("Enter an integer: ")) if a <= 0: b = b +1 else: a = a + 1 if a > 0 and b > 0: print ("W") elif a > 0: print("X") if b > 0: print("Y") else: print("Z")What letters will be printed if the user enters 1 for a and 0 for b ?
Consider the following code segment:
a = int(input("Enter an integer: ")) b = int(input("Enter an integer: ")) if a <= 0: b = b +1 else: a = a + 1 if a > 0 and b > 0: print ("W") elif a > 0: print("X") if b > 0: print("Y") else: print("Z")What letters will be printed if the user enters -1 for a and -1 for b?
Which of the following is not a valid loop in Python ?
Which of the following statement(s) will terminate the whole loop and proceed to the statement following the loop ?