From 197e5d240442f22a98871ea756a814a691baeb90 Mon Sep 17 00:00:00 2001 From: Vicky-Raghuwanshi <67050782+Vicky-Raghuwanshi@users.noreply.github.com> Date: Wed, 27 Oct 2021 20:50:23 +0530 Subject: [PATCH] ForLoops.rst For loop with additional example --- source/loops.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/loops.rst b/source/loops.rst index c50d1be..3191ed0 100644 --- a/source/loops.rst +++ b/source/loops.rst @@ -159,3 +159,21 @@ drawing code that's inside both. Here's what it can look like:: Replace the ``...``'s with your own code, and see if you can come up with something funny or interesting! :sup:`Mistakes are encouraged!` + +You can also use list,tuple and string in the place of range() function we are using on for loop. +For Example : + +month_list = ["June","July","August","September"] + +for month in month_list: + print("Month : ",month) + + +OUTPUT: +________________________________________ +Month : June +Month : July +Month : August +Month : September + +* Similarly we can use the tuple and other elements container.