REVERSE FIND In Python?? #python #coding #programming

preview_player
Показать описание
This short shows you how to use the .rfind() method in Python as well as the .title() method.

Background Music:
Creative Commons / Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Рекомендации по теме
Комментарии
Автор

Good stuff.

Just a small thing that I think could be improved with the example is the placement of the two b’s as you could get the right answer for the wrong reason.

If you didn’t know what the title method does and worked on the assumption that the x string is stored in y as is, and also thought rfind was an reverse, then a find (ie the index on the reversed string, not the unreversed string), you could still end up with an answer of 4.

If you either removed title from the example or changed it to abcABCD then there’s no wrong way of getting to the right answer.

notenoughmonkeys
Автор

So what you're telling me is this is more about title() changing the word to all lowercase besides the first letter than about rfind()

joltedjon
Автор

A good one.
Please continue these videos. These are clearing my doubts and getting the basics strong.

sandeeptuluri
Автор

rfind scans the string from the right that’s why it finds the last occurrence.

jainishpatel
Автор

Man, this kind of videos is so helpful 👌

Mohamed_MDJ
Автор

These are addictive. A catchy title for preview image would be nice as opposed to tiny code

justinpobrien
Автор

The definition of the title method on google is only partially correct. How sad

AngryEgg
Автор

Thx for the tip, could you also share the song at the end please?

jimmycimitir
Автор

The answer is always error, because when I type these challenges into my terminal, I forget something.

barodrinksbeer
Автор

Is it safe to say - rfind is find from right?

MK-youtube
Автор

This is an exercise in attention rather than in programming skills

parzh
Автор

Why specify the index if you're taking the last one anyway? Only cases I use pop is if I want the last index, otherwise I just remove or replace the value at the index for better optimization

aggi
Автор

I got the right answer for the wrong reason.... 🤠

dgpreston