Question #254370

3. Decimal Count-off

by CodeChum Admin

Counting off a list of decimal numbers is hard when you speak it, but not when you code it! Don't believe me? Then let's try coding just that!


Instructions

  1. A list containing 10 predefined float values are already provided for you in the code editor. Print each of the element out in separate lines, starting from the last list element down to the first.

Output

Multiple lines containing a decimal number.

5.1
5.5
4.00001
4.024
3.0
3.66
2.5
2.2
1.2054
1.4

Expert's answer

l = [ 5.1, 5.5, 4.00001, 4.024, 3.0, 3.66, 2.5, 2.2, 1.2054, 1.4 ]

for i in range(9, -1, -1):
    print(l[i])

Output:
1.4
1.2054
2.2
2.5
3.66
3.0
4.024
4.00001
5.5
5.1
LATEST TUTORIALS
APPROVED BY CLIENTS