Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Full lesson preview

Iterate In Reverse Order

Traverse a sequence from the end to the start and collect elements in reversed order.

Python practice8 minLoops & IterationBeginnerLast updated March 15, 2026

Problem statement

Given a list, iterate over it in reverse order and return a new list containing the elements from last to first. Do not simply call list.reverse() in-place; produce a new list by iterating in reverse.

Task

Practice iterating in reverse using loops and return the reversed sequence as a new list.

Examples

Reverse numbers

Input

iterate_in_reverse([1,2,3])

Output

[3, 2, 1]

The function visits elements from the end to the start and collects them.

Input format

A single list: iterate_in_reverse(lst)

Output format

A list with elements in reverse order: [last, ..., first]

Constraints

- The input list may be empty. - Preserve elements as-is (do not copy or transform them beyond reordering).

Samples

Sample 1

Input

iterate_in_reverse(['a','b'])

Output

['b', 'a']

Reversed order of two elements.