From 0809095518a4dae775b688e3110bc481d3aa26a0 Mon Sep 17 00:00:00 2001 From: Akash singh <83067464+kshatriyaakash@users.noreply.github.com> Date: Fri, 29 Oct 2021 21:14:05 +0530 Subject: [PATCH] Loop in Python --- Loops.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Loops.py diff --git a/Loops.py b/Loops.py new file mode 100644 index 00000000..6a33bc7a --- /dev/null +++ b/Loops.py @@ -0,0 +1,9 @@ +# Python For Loop : the for loop in python is used to iterate over a sequence(list,tuple string) or other iterable objects. + +# iterating over a sequence is called traversal + + +#for loops with list +a=['apple','mango','banana','orange'] +for name in a: + print(name *2) # when a string is multiplied to any integer it gets itself repeated that many times