Computer Science
Following code prints the given list in ascending order. Modify the code so that the elements are printed in the reverse order of the result produced by the given code.
numbers = list(range(0, 51, 4))
i = 0
while i < len(numbers):
print(numbers[i] , end = " ")
i += 3
# gives output as : 0 12 24 36 48
Related Questions
Consider the following code and predict the result of the following statements.
bieber = ['om', 'nom', 'nom'] counts = [1, 2, 3] nums = counts nums.append(4)
- counts is nums
- counts is add([1, 2], [3, 4])
What is the output of the following code?
numbers = list(range(0, 51, 4)) results = [] for number in numbers: if not number % 3: results.append(number) print(results)
Write a program to increment the elements of a list with a number.
Write a program that reverses a list of integers (in place).