From b25e03adfd7441d93e02c968d8812ec6c9be7950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Sun, 9 Jun 2024 19:11:22 +0300 Subject: [PATCH] reverse list example/homework --- python/reverse_list.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 python/reverse_list.py diff --git a/python/reverse_list.py b/python/reverse_list.py new file mode 100644 index 0000000..d0d1c32 --- /dev/null +++ b/python/reverse_list.py @@ -0,0 +1,7 @@ +a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +i = len(a) - 1 + +while i >= 0: + print(a[i], end=' ') + i -= 1