Python tutorial 25.07.2024

arokya_naresh_178a488116e

Arokya Naresh

Posted on July 25, 2024

Python tutorial 25.07.2024

SLICING
we can hop btwn letters in the index

        H   e   l   l   o   m   o   b   i   l   e
Enter fullscreen mode Exit fullscreen mode

Positive Indexing 0 1 2 3 4 5 6 7 8 9 10
Negative Indexing -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1

Eg1:
msg='HelloMobile'
print(msg[0:11:2]) -->2 denotes hop (i.e no. of hop inbtwn letter )
print(msg[0:11:3])

o/p
Hlooie
Hlol

Iterable-is a container of value which we can iterate by using loop

eg:
loop='Apple'
for d in loop[1:]:
print(d)

A
p
p
l
e

Here loop is that container which has values Apple.To get to know what is in that loop we use for loop which we can iterate

💖 💪 🙅 🚩
arokya_naresh_178a488116e
Arokya Naresh

Posted on July 25, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024