From 458f9c135dcf5d571a98cb90e5ee044cdbfaf5b8 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:51:12 -0500 Subject: [PATCH] completed 3-8 Seeing the World --- Chapter_03/3-8_seeingTheWorld.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Chapter_03/3-8_seeingTheWorld.py diff --git a/Chapter_03/3-8_seeingTheWorld.py b/Chapter_03/3-8_seeingTheWorld.py new file mode 100644 index 0000000..f6bd673 --- /dev/null +++ b/Chapter_03/3-8_seeingTheWorld.py @@ -0,0 +1,15 @@ +# Exercise 3-8 Seeing the World +# Learning Objective: Utilize sorted(), reverse(), and sort() methods on a list. + +placesToVisit = ['Zimbabwe', 'Georgia', 'Anarctica', 'Puerto Rico', 'Cuba'] +print(placesToVisit) +print(sorted(placesToVisit)) +print(placesToVisit) +placesToVisit.reverse() +print(placesToVisit) +placesToVisit.reverse() +print(placesToVisit) +placesToVisit.sort() +print(placesToVisit) +placesToVisit.sort(reverse=True) +print(placesToVisit) \ No newline at end of file