Find and Replace Method : Python tutorial 34

preview_player
Показать описание
Guys please help this channel to reach 80,000 subscribers. I'll keep uploading quality content for you.

Python is easy programming language to learn and anyone can learn it, and these tutorials are 100% free in hindi.

You can share this playlist with your brother, sisters and friends. This will surely add some values to their life.

If you follow this complete playlist of python tutorial surely you will learn everything about python programming language.

This video is all about find and replace method

Рекомендации по теме
Комментарии
Автор

me:getting more serious about learning it..
teacher: at 1:25 No hate, she is still beautiful and good dancer !!!
me:laughing during the class 😂😂😂😂😂😂
thats called a true dedicated teacher who can relax ur mind during a serious topic also.. 💜💜💜💜

dipanwitabhowmik
Автор

The best python tutorial on youtube. keep it up bro.

souravdutta
Автор

your explanation is very nice.
keep continue and brings more tutorials us .
you are doing great job.

AniketKumar-bmgi
Автор

we are doing like this also!, and you r too good harshit love u bro 😘😘

string = "She is beautiful and she is good dancer"
print(string.find("is", 5))

kapilbhardwaj
Автор

nice extension of replace and find fn:
replace(" ", "", no of times we want this repalcement)
find(" ", pos from which we have to start)

akshatbhutra
Автор

no hate😂😂😂😂
sir u are amazing..I am extremely enjoying this tutorial

AbhishekSingh-yhce
Автор

Your every explanation is very Please Share more on python ....Need 2-3 project practice on python

akankshakumari
Автор

Very nice sir for making the python video in detail

Developer-rl
Автор

'The greatest glory in living lies not in never falling, but in rising every time we fall'
that's the code:

1.print(nam4.find('in', ))
2.print( nam4.find('in', 20))
3.pos1 = nam4.find(' in ', 19)
4.print( nam4.find('in', pos1+1))


output:
19
25
38

by using method of line 2 i find 'in' in the living ' liv"in"ing' with position 25
while using line 3 and 4 I find 'in' in the right position 38 why?

Daniyal-epcj
Автор

very nice explanation sir i got it after watch three to four time also i create a program to find user input sentences and word as well

scottmiller
Автор

great, all the content is very helpful, thanks harshit.

shivomverma
Автор

i = 0
integer_array = [1, 0, 2, 3]
#Get the position of all the is
def get_pos(string, key, pos = 0, i = 0):
    pos = string.find(key, pos + len(key))
    if(pos == -1):
        pass
    else:
        integer_array[i] = pos
        i =i+1
        get_pos(string, key, pos, i)

string = "John is a nice guy and is also awesome and is genius and is happy"
key = "is"
#get_pos(input("Enter the string to find: "), input("Enter the search key: "))
get_pos(string, key)
print(integer_array)

dob
Автор

Sir, Tell me one thing .... If I want to replace 2nd "is" then what to do ?

alien_couple
Автор

a="She is one of the beautiful among them.. she is seucy"
c=a.find("is")
print(a.find("is", c+1))

pranjalpandey
Автор

string = "is my name is X and my bro name is y"
pos_1 = string.find("is")
pos_2 = string.find("is", pos_1+1)
pos_3 = string.find("is", pos_2+1)
print("the first is position is ", pos_1)
print("the second is position is ", pos_2)
print("the third is position is", pos_3)

arpitraykar
Автор

she is not only beautiful but also good dancer. I just fall in love with her😍

mahathirmohammad
Автор

One Ques:

What if I want to replace only second "IS" with "WAS" ??

how to do that ??

being__maniac
Автор

hi Harshit,
It's really good to watch your videos. So many concepts has been cleared and your way of explanation is quit fabulous. can I find index position of a word at nth position after taking that input from user? I have written some code but it's only finding the word till the 1st index position and not next to that or as per the user input. Both code and output is given below. Please suggest.

code

para = "abc is cde's friend and ref is looking forward to cde while abc is looking abc forward to abc ref cde. So, is it a circle "
word = input("Please enter a word to find its first index position: ")
word1 = int(input("Please enter a word to find its required index position: "))
a = para.find(word)
b = para.find(word, a + word1)
print(f"First index position of the word {word} is at {a}")
print(f"{word1}th times word is present at index position {b}")

output

$ python file1.py
Please enter a word to find its first index position: is
Please enter a word to find its required index position: 2
First index position of the word is is at 4
2th times word is present at index position 28

if i enter index position 3 then also i am getting 28 as output.

ruturajmishra
Автор

bro why it is showing -1 if there is no char present in my string which i m finding like:
string="mayank"
print(string.find("t"))
it convention of find method???

stock
Автор

Bro aaj mai itna hasa hu na jitna mai aaj ke phle kisi online study me nhi hasa
😂😂Iss is me dusra iss iss😂😂😂
Thanks for haste haste padhna sikho

Robin-wfnu