1. strings are immutable. 2. any method on string takes a copy of the object. 3.string.upper will convert the string to an upper case 4.string.lower will convert the string to lower case 5. string.rstrip("character") will strip the trailing characters of string 6.string.replace("character/alphabets", new character/alphabets") will replace the existing specified alphabets in string with new ones 7. string.split splits the string at the given alphabet and returns a list of items 8.string.capitalize capitalizes the first character of the word and turns rest all the characters to lower case 9.string.center center aligns the string by adding the number of spaces mentioned in parenthesis 10. string.count counts the total number of a particular set of characters in a string 11. string.endswith checks whether a string ends with the specific characters 12.string.find finds the first occurrence of a given value and return the index value of the position of that occurrence 13.string.index finds the occurrence of a given value and returns the index value of the position however, if it is unable to find it will give an error causing the program to exit 14.string.isalnum checks to find if string is alphanumeric and returns true or false 15.string.isalpha checks if there are any numbers in the string 16.string.islower checks if there are only lower aphabets in the string 17. string.isprintable checks if all the characters are printable in the string(non printable characters e.g ) 18 string.isspace checks if any space bar has been used in the string 19.string.istitle The istitile() returns True only if the first letter of each word of the string is capitalized, else 20. string.isupper checks if all characters are uppercase in a string 21. string.startswith checks if a string starts with a given value 22. string.swapcase convert uppercase to lowercase and vice versa in a string 23.string.title converts first character of all the words in the sentence to capital
you forgot () in strip code here the right code , i hope this will help you wrong : print(str2.strip) right : print(str2.strip()) #HarryBhai #codewithharry @CodeWithHarry
@@Sibivlogs99 I think in python find will return a bool value where a particular given element is present on the another hand index will return the particular index in which element is present
Here are few more string methods which may be useful to someone: 1. casefold(): similar to lower() but more aggressive and strong. 2. encode(): return a encoded version of a string. 3. format(): format specific values inside the string.
'rstrip' function strips the character from right side and there is another command 'lstrips' which strips the character from left side and 'strip' function strips the character from anyside of the string
08:41 Bro you made things complex as you just printed the length of str1.center(50) center function centers the string from both ends of the string For instance: You should give the example like this: name = "Harry" print(name.center(9), end=",") # you can use any symbol instead of comma This will be a good and unambiguous example. This will show that 9-5=4 and 2 spaces will be given to start of the string and 2 at last and at the end of all comma will be printed. I hope you will consider my suggestion. I said it because my 2 friends are also watching the playlist and their concept was not cleared about center function.
one more question- name = "Harry" print(name.center(9), end=",") isme agar mujhe dekhna hai ki index [2] pe konsa character hai to kya code hoga, index access ka general code ye hota hai ki print(string[2]), but yahan string ki jagah kya likhna hoga agar ye code use kru to
I have Python in my syllabus,I'm in 8th grade,I discovered this playlist a while ago ,at first i decided to learn as much in my syllabus but after watching a few tutorials,I fell in love with Python and the teaching skills of CodeWithHarry sir and I am eager to learn more and complete this playlist.Thank you so much sir❤❤
00:02 Python string methods include operations like converting to uppercase and lowercase, finding string length, and understanding string immutability. 01:56 String methods in Python can change the case and strip trailing characters 04:03 String methods in Python include strip, replace, and split. 06:04 Capitalize the first letter of a string 07:57 Python's string methods like center() and count() offer useful functionalities for manipulating and analyzing strings. 09:56 String methods like ends with and find are important for string manipulation. 12:01 String methods in Python provide functionality for searching and manipulating strings. 14:07 String methods in Python for checking characters and punctuation 16:05 String methods in Python can determine if characters are printable or whitespace. 18:04 String methods in Python include start, swap case, and title. They manipulate strings in various ways. 19:42 Using Continuity camera to connect iPhone and MacBook 21:11 The video discusses improving mic setup and desk view \
a = input("Enter your first Number: ") x=input ("Enter your operator: ") b=input ("Enter your second Number: ") if x== "+":print(int(a)+(int(b))) if x== "-":print(int(a)-(int(b))) if x== "*":print(int(a)*(int(b))) if x== "/":print(int(a)/(int(b)))
mei to , harry bhai like karne ke liya aata hun , aur like kar ke chala jata hun, apke channel se java sikh raha hun ab, aur mera excitement badh raha he, apke channel se me sab sikhunga future mein.🙂👍🏻👍🏻👍🏻
studied java in previous sem and got to this, all the methods are quite easier to me. Its fun. I had tried to learn from this series previously too, but I got too confused, but coming after learning java, python feels a little easier as of day 13
Day3 of #100DaysOfCode. Today in this video13, I learned about various string methods in Python, such as upper(), lower(), strip(), replace(), split(), and many others. These methods will help me manipulate strings effectively, such as changing character casing, aligning text, counting occurrences, and checking specific conditions within strings. Thank You Harry Bhaiya.
15:13 हैरी को मजा आ गया तीन व्यूज एक स्क्रीन में करके ।कभी सोचा होगा की जो लोग मोबाइल में देखते होंगे इनका क्या हाल होगा ,ज्यादातर मोबाइल में ही देखते हैं।अब तो रिप्लिट भी मोबाइल में आ गया
# converting string into uppercase note: strings are immutable a = "Harry" print(len(a)) print(a.upper()) print(a.lower()) # one more example of upper() and lower() functions str1 = "AbcDEfghIJ" print(str1.upper()) print(str1.lower()) # using strip() function we can remove white spaces before and after string str2 = " Silver Spoon " print(str2.strip()) # rstrip() function used to remove any trailing characters str3 = "Hello !!!" print(str3.rstrip("!")) # replace() method using which we can replace all occurences of string with another string str2 = "Silver Spoon" print(str2.replace("Sp", "m")) # split() method splits the given string at the specified instance and returns the separated strings as list items. str2 = "Silver Spoon" print(str2.split(" ")) # capitalize() method is used to turn first character of string into uppercase and rest into lower case str1 = "hello" capStr1 = str1.capitalize() print(capStr1) str2 = "hello World" capStr2 = str2.capitalize() print(capStr2) # using center() method to align the string to the center str1 = "Welcome to the Console!!!" print(str1.center(50)) # another example of center() method str1 = "Welcome to the Console!!!" print(str1.center(50, ".")) # count() method returns the number of times the given value has occured within the given string str2 = "Abracadabra" countStr = str2.count("a") print(countStr) # endswith() method checks if the string ends with a given value. If yes then return True, else return False. str1 = "Welcome to the Console !!!" print(str1.endswith("Console !!!")) # another example of endswith() checking for a value in between the string by providing start and end index positions. print(str1.endswith("to", 4, 10)) # find() method searches for the first occurrence of the given value and returns the index where it is present. If given value is absent from the string then return -1. str1 = "He's name is Dan. He is an honest man." print(str1.find("is")) print(str1.find("Daniel")) # index() method searches for the first occurrence of the given value and returns the index where it is present. If given value is absent from the string then raise an exception. str1 = "He's name is Dan. Dan is an honest man." print(str1.index("Dan")) # print(str1.index("Daniel")) # this will show a value error # isalnum() method returns True only if the entire string only consists of A-Z, a-z, 0-9. If any other characters or punctuations are present, then it returns false. str1 = "WelcometoTheConsole" print(str1.isalnum()) # isalpha() method returns True only if the entire string only consists of A-Z, a-z. If any other characters or punctuations or numbers(0-9) are present, then it returns false. str1 = "Welcome" print(str1.isalpha()) # islower() method returns True if all the characters in the string are lower case, else it returns false. str1 = "hello world" print(str1.islower()) # isprintable() method returns True if all the values within given string are printable, if not, then return False. str1 = "We wish you a Merry Christmas" print(str1.isprintable()) str1 = "We wish you a Merry Christmas " print(str1.isprintable()) # this will return False # isspace() method returns True only and only if the string contains white spaces, else returns False. str1 = " " # using spacebar print(str1.isspace()) str2 = " " # using Tab print(str1.isspace()) # istitle() method returns True only if the first letter of each word of the string is capitalized, else it returns False str1 = "World Health Organization" print(str1.istitle()) str2 = "To kill a Mocking bird" print(str2.istitle()) # isupper() method returns Ture if all the characters in the string are upper case, else it returns False. str1 = "WORLD HEALTH ORGANIZATION" print(str1.isupper()) # startswith() method checks if the string starts with a given value. If yes then return True, else return False. str1 = "Python is a Interpreted Language" print(str1.startswith("Python")) # swapcase() method changes the character casing of the string. Upper case are converted to lower case and lower case to upper case. str1 = "Python is a Interpreted Language" print(str1.swapcase()) # title() method capitalizes first letter of each word within the string str1 = "He's name is Dan. Dan is an honest man" print(str1.title())
11:00 Output of the code = ar nm ="Harry" print(nm[-4:-2]) Output - ar Reason: print (nm[-4:-2]) = print (nm[nm(len)-4:nm(len)-2]) =print (nm[1:3]) Here it would print index assigned from 1 to 3 but not including index 3 . Will print till index 2
free code camp se smja man ebut clear nhe ho paya but harry bhai kamal ha awesome smj arhe ha or mza bhe end ka araha ha dil krta ha foran next next kro
Present on #Day13 (11-Dec-22). Harry bhai you're really taking this course on a next level! Your older tutorials didn't contain so many methods. Thank you for your efforts.
@@aadisingh8742 yeah learnt a lot of new things from that course and also made a few custom projects, but nowadays I've to focus on studies more because of my poor grades
center method will add the blank spaces on both side of string str1 = "Welcome to the Console!!!" print(len(str1)) print(len(str1.center(50))) o=str1.center(50) print("start:",o[0:12]) print("End :",o[37:50]) print(o[12:38]) print(str1.center(50)) Output: 25 50 start: End : Welcome to the Console!!! Welcome to the Console!!!
bhai is video me aap bht jyada fast ho gye aur kai chije jaldbazi me bata diya bina better explanation ke i m beginer nd is video me lgbhag sbkuch sir ke upar se chala gya mere
One correction is that capitalize method converts all other characters to lowercase, regardless of whether the first character was initially uppercase or not.
done day# 14 title method is most important methon ye str me likhe charc ke first letter ko upper case me convert kardeta h istitle method check karta h ki char lower case me h ya nhi isupper method me check karta h ki char upper case me h ya nhi
thnks for your efforts for making this useful videos watching python videos here regularly .i am doing mca from ip .and again thnks for your hrd work dude
Harry bhai i am late because my semester exam is going on but I daily see your video because you are best teacher who teach us python easily . # STRING ARE IMPUTIABLE a = "yash!!!!" print(len(a)) # UPPER CASE METHOD print(a.upper()) # SO IN THIS WE CAN CHANGE THE STRING IN CAPITAL LETTER #LOWER CASE METHOD print(a.lower()) # SO THIS IS LOWER CASE METHOD . # RSTRIP METHOD print(a.rstrip("!")) # SO RSTRIP METHOD REMOVE ONLY ENDING STRIPS LIKE "!" FROM STRING . # THIS METHOD NOT REMOVE STARTING STRIP LIKE "!!YASH" SO THIS OUTPUT IS : !!YASH # REPLACE METHOD print(a.replace("yash!!!!","harry bhai ")) # CAPITALIZE METHOD harry="good teAcher" print(harry.capitalize()) # SO THIS METHOD CONVERT 1ST LATER IN CAPITAL LETTER IN OUR LINE # BUT THIS METHOD CONVERT ALL LETTERS IN SMALL LETTER # OUTPUT IS : Good teacher # CENTER METHOD print(len(harry)) #output is : 12 print(len(harry.center(50))) # AND THIS OUTPUT IS : 50 # COUNT METHOD print(harry.count("good teacher ")) # SO THIS METHOD COUNT HOW MANY TIME good teacher REPEAT IN STRING . OUTPUT: 0 # FIND METHOD print(harry.find("A")) # SO THIS METHOD FIND INDEX OF A IN OUR STRING MEANS WHICH PLACE A IS STAY IN OUR STRING # THIS METHOD TELL US LOCATION OF A IN OUR STRING WITH THE HELP OF NUMBER SO OUTPUT IS : 7 # ISLOWER METHOD : print(harry.islower()) # SO OUTPUT IS : FALSE BECAUSE OUR ALL STRING LETTER IS NOT IN LOWER SO OUTPUT IS FALSE . # ISSPACE METHOD : print(harry.isspace()) # SO THIS METHOD RETURN FALSE BECAUSE IN OUR STRING DO NOT HAVE ANY WHITE SPACE # SWAPCASE METHOD: print(harry.swapcase()) # THIS METHOD CONVERT LOWER CASE TO UPPER AND UPPER TO LOWER STRING OUTPUT IS : GOOD TEaCHER # TITLE METHOD : print (harry.title()) #output is : Good Teacher means it convert all string 1st letter in capital.
len-finds the length of the string upper-capitalizes each letter of the string into upper case lower-coverts all the characters of the string into lower case capitalize- capitalizes only 1st letter of the string & turned rest of the letter into lower case isupper-Returns True if all the characters of the string r in upper case islower-Returns True if all the characters of the string r in lower case title-Capitalizes each 1st letter of the string into upper case istitle-Returns True if each 1st letter of the string r in upper case isalpha- returns True if the characters of the string contains A-Z or a-z , if there is any special symbols, punctuations etc then it returns false. isalnum- returns True if the characters of the string contains A-Z or a-z or 0-9 , if there is any special symbols, punctuations etc then it returns false. isprintable-returns True if the characters of the string r printable,else it returns false. isspace-returns True if the string contains white spaces,else it returns false. startswith-returns True if the string starts with the given value,else it returns false. endswith- returns True if the string ends with the given value. split()- converts the string into the list center()-Aligns the string into the centre as per the argument given. index()-searches for the first occurrence of the given value & returns the index number where it is present. find()-finds the 1st occurrence of the given value & returns the index number if it is not present it returns -1. swapcase()-Coverts the uppercase of the string into lower case & vice-versa count()-counts the occurrence of the given value in the string rstrip()-strips the given value from the right side of the string lstrip()-strips the given value from the left side of the string replace("existing val","new val")- replace the existing value with the new given value
Bhaiya everything was good but u misspelled one thing that, when we use center cmd let's say here its 50 so for 25 character there will be 12 leading spaces and 13 trailing spaces instead of all 25 leading spaces, remaining everything was fire thank youu so much!! Edit:- I identified it while i was using : st1="Welcome to the Console!!!" print(st1.center(50,".")) # Here if we don't want spaces but this(.) we can use the following cmd terminal=> ............Welcome to the Console!!!.............
Instagram (for those who want to mention, I will try to mention everyone back): instagram.com/codewithharry/
Thank you sir
Okay Sir thank you❤
Love you #harrybhai
Love you #harrybhai
Fork repell was so important
1. strings are immutable.
2. any method on string takes a copy of the object.
3.string.upper will convert the string to an upper case
4.string.lower will convert the string to lower case
5. string.rstrip("character") will strip the trailing characters of string
6.string.replace("character/alphabets", new character/alphabets") will replace the existing specified alphabets in string with new ones
7. string.split splits the string at the given alphabet and returns a list of items
8.string.capitalize capitalizes the first character of the word and turns rest all the characters to lower case
9.string.center center aligns the string by adding the number of spaces mentioned in parenthesis
10. string.count counts the total number of a particular set of characters in a string
11. string.endswith checks whether a string ends with the specific characters
12.string.find finds the first occurrence of a given value and return the index value of the position of that occurrence
13.string.index finds the occurrence of a given value and returns the index value of the position however, if it is unable to find it will give an error causing the program to exit
14.string.isalnum checks to find if string is alphanumeric and returns true or false
15.string.isalpha checks if there are any numbers in the string
16.string.islower checks if there are only lower aphabets in the string
17. string.isprintable checks if all the characters are printable in the string(non printable characters e.g
)
18 string.isspace checks if any space bar has been used in the string
19.string.istitle The istitile() returns True only if the first letter of each word of the string is capitalized, else 20. string.isupper checks if all characters are uppercase in a string
21. string.startswith checks if a string starts with a given value
22. string.swapcase convert uppercase to lowercase and vice versa in a string
23.string.title converts first character of all the words in the sentence to capital
Thnks v.much
Time kaha se mila
Thankyou very much brother , I was making the notes of all lectures . And this helped me a lot .
does the replace method change original string as harry said strings are immutable
@@pinkijha5320 No. it creates a new copy of the object with the replaced words.Cheers
Ready with Harry bhai.... For day 13
It is the first time when I stood constant with any series on youtube or Netflix.... Salute to Harry bhai...
bro same line ko copy krny ka shortcut kya ha
@@lenovopc9777 shift + alt + down key
@@shivamawasthi765 ctrl+d
@@lenovopc9777 for copy= ctrl+c and for paste=ctrl+v
ctrl+d or alt+shift+down key
Code Backup Repository: github.com/CodeWithHarry/100-days-of-code-youtube
sir is this also use in hacking plz plz tell
you forgot () in strip code here the right code , i hope this will help you
wrong : print(str2.strip)
right : print(str2.strip())
#HarryBhai #codewithharry @CodeWithHarry
Harry bhaiyya aap ka python wala T-sirt kaha se purchase kiya hai please batado
i am using it on replit but it asking fir card details or payment for fork ?
1-- upper()
2-- lower()
3-- rstrip()
4-- replace("find","replace")
5-- split (" ")
6-- capitalize()
7-- center()
8-- count()
9-- endswith()
10-- find()
11-- index()
12-- isalnum()
13-- isalpha()
14-- islower()
15-- isprintable()
16-- isspace()
17-- istitle()
18--startswith()
19-- swapcase()
20-- title()
Hey bro
Can you asked me that how (find) and (index) work in python
@@Sibivlogs99 I think in python find will return a bool value where a particular given element is present on the another hand index will return the particular index in which element is present
bro there is another string method name lstrip()
which strip the string from left side
Here are few more string methods which may be useful to someone:
1. casefold(): similar to lower() but more aggressive and strong.
2. encode(): return a encoded version of a string.
3. format(): format specific values inside the string.
Very best channels for study all programming langauge
English Sikh le
@@swapneel9276 🤣😂😂🤣😂
@@swapneel9276 bhai ko confuse mat karo, python language ke baad English language bhi seekh lega🗿
@@swapneel9276" Channels = channel / platform " ," for = to " , "study= learn", " All = any (is best ) " , " language = languages"
@@ff_hrbhai kya kar rha hai ,padhle
Mobile phone me coding karne walo ke jazbe ko dil se salam. ❤️🔥🤝 don't give up keep trying
Thank you❤ radhe radhe❤
Coding with mobile🥵
Koi itni mehnat kaisay kr skta hai aur wo bhi itni honesty k sath😇...Kamaal hai..Too much Impressive😍
'rstrip' function strips the character from right side and there is another command 'lstrips' which strips the character from left side and 'strip' function strips the character from anyside of the string
woah thankyou so much
bhai lekin kewal strip function lgane se eclamation mark na to right me lagega n to left me
Man hats off, u r teaching for free and in a good quality too
08:41
Bro you made things complex as you just printed the length of str1.center(50)
center function centers the string from both ends of the string
For instance:
You should give the example like this:
name = "Harry"
print(name.center(9), end=",") # you can use any symbol instead of comma
This will be a good and unambiguous example.
This will show that 9-5=4 and 2 spaces will be given to start of the string and 2 at last and at the end of all comma will be printed.
I hope you will consider my suggestion.
I said it because my 2 friends are also watching the playlist and their concept was not cleared about center function.
name = "Tech Tech Wizard"
print(name.split("T"))
Answer:
['', 'ech ', 'ech Wizard']
isme single quotes kyu aa rahi 2 start me?
one more question-
name = "Harry"
print(name.center(9), end=",")
isme agar mujhe dekhna hai ki index [2] pe konsa character hai to kya code hoga, index access ka general code ye hota hai ki print(string[2]), but yahan string ki jagah kya likhna hoga agar ye code use kru to
@@SS-ds9lg string~name
I was going through comments to see about the center. Thank you very much for this one.
@@SS-ds9lg jis variable ka index find krna uska name enter kro gy , is example main, print(name[2])
I have Python in my syllabus,I'm in 8th grade,I discovered this playlist a while ago ,at first i decided to learn as much in my syllabus but after watching a few tutorials,I fell in love with Python and the teaching skills of CodeWithHarry sir and I am eager to learn more and complete this playlist.Thank you so much sir❤❤
Which board ??
I'm in 6
me also in 8th
Thank you Harry Bhai I was very confuse before this video on how i can get access to you repels but from now i can easily access your repels.
I am not able to find words to thank you for your kind efforts in teaching us very deeply .....thank u so much....jazak Allah😊
Masha allah, May Allah bless u with hidayah and peaceful life in this world and also with ..."(Jannatul Ferdous)"...in the Akhirah Ameen
00:02 Python string methods include operations like converting to uppercase and lowercase, finding string length, and understanding string immutability.
01:56 String methods in Python can change the case and strip trailing characters
04:03 String methods in Python include strip, replace, and split.
06:04 Capitalize the first letter of a string
07:57 Python's string methods like center() and count() offer useful functionalities for manipulating and analyzing strings.
09:56 String methods like ends with and find are important for string manipulation.
12:01 String methods in Python provide functionality for searching and manipulating strings.
14:07 String methods in Python for checking characters and punctuation
16:05 String methods in Python can determine if characters are printable or whitespace.
18:04 String methods in Python include start, swap case, and title. They manipulate strings in various ways.
19:42 Using Continuity camera to connect iPhone and MacBook
21:11 The video discusses improving mic setup and desk view
\
Harry bhaiya, I am late but speeding up and learning fast with your great explaination...we are lucky to have a teacher like you...Thank you😃
Mind blowing explanation of each and every points sir.. Teaching technique is really a best and understandable..
Note: If you are going though sentences , it counts space too. (for string slicing)
that is why i was confused in the previous exercise
thanks bro exactly what I want to hear thanks
a = input("Enter your first Number: ")
x=input ("Enter your operator: ")
b=input ("Enter your second Number: ")
if x== "+":print(int(a)+(int(b)))
if x== "-":print(int(a)-(int(b)))
if x== "*":print(int(a)*(int(b)))
if x== "/":print(int(a)/(int(b)))
you are a brillient youtuber bro i feel like my own brother teaching me how to code.
love your content......🥰🥰🥰🥰
HELLO HARRY BHAI I AM FROM PAKISTAN YOU ARE TEACHING VERY GOOD STYLE I AM VERY VERY BEIGGNERS STUDENTS IN PYTHON . THANKS FOR TEACHING
mei to , harry bhai like karne ke liya aata hun , aur like kar ke chala jata hun, apke channel se java sikh raha hun ab, aur mera excitement badh raha he, apke channel se me sab sikhunga future mein.🙂👍🏻👍🏻👍🏻
jo bhi doubt aate hai wo aap apne videos mein include kar lete hun..thanks a lot sir
studied java in previous sem and got to this, all the methods are quite easier to me. Its fun. I had tried to learn from this series previously too, but I got too confused, but coming after learning java, python feels a little easier as of day 13
4:04 if we want to remove the ! form left side " that is in starting " we will use lstrip()
Day3 of #100DaysOfCode. Today in this video13, I learned about various string methods in Python, such as upper(), lower(), strip(), replace(), split(), and many others. These methods will help me manipulate strings effectively, such as changing character casing, aligning text, counting occurrences, and checking specific conditions within strings.
Thank You Harry Bhaiya.
Bro, do I have to learn all the string methods in Python?
@@MustafaAhmed-xk4mf same question
Bahut hi khubsoorat.. tarike se course banaya hai sab kuchh top notch hai
who is learning nowdays🤩
15:13 हैरी को मजा आ गया तीन व्यूज एक स्क्रीन में करके ।कभी सोचा होगा की जो लोग मोबाइल में देखते होंगे इनका क्या हाल होगा ,ज्यादातर मोबाइल में ही देखते हैं।अब तो रिप्लिट भी मोबाइल में आ गया
Thank you very much Harry Bhai for making us learn Python for free and I saw that you were recording the video at midnight in some videos
how to run another file other than main.py in a repl
# converting string into uppercase note: strings are immutable
a = "Harry"
print(len(a))
print(a.upper())
print(a.lower())
# one more example of upper() and lower() functions
str1 = "AbcDEfghIJ"
print(str1.upper())
print(str1.lower())
# using strip() function we can remove white spaces before and after string
str2 = " Silver Spoon "
print(str2.strip())
# rstrip() function used to remove any trailing characters
str3 = "Hello !!!"
print(str3.rstrip("!"))
# replace() method using which we can replace all occurences of string with another string
str2 = "Silver Spoon"
print(str2.replace("Sp", "m"))
# split() method splits the given string at the specified instance and returns the separated strings as list items.
str2 = "Silver Spoon"
print(str2.split(" "))
# capitalize() method is used to turn first character of string into uppercase and rest into lower case
str1 = "hello"
capStr1 = str1.capitalize()
print(capStr1)
str2 = "hello World"
capStr2 = str2.capitalize()
print(capStr2)
# using center() method to align the string to the center
str1 = "Welcome to the Console!!!"
print(str1.center(50))
# another example of center() method
str1 = "Welcome to the Console!!!"
print(str1.center(50, "."))
# count() method returns the number of times the given value has occured within the given string
str2 = "Abracadabra"
countStr = str2.count("a")
print(countStr)
# endswith() method checks if the string ends with a given value. If yes then return True, else return False.
str1 = "Welcome to the Console !!!"
print(str1.endswith("Console !!!"))
# another example of endswith() checking for a value in between the string by providing start and end index positions.
print(str1.endswith("to", 4, 10))
# find() method searches for the first occurrence of the given value and returns the index where it is present. If given value is absent from the string then return -1.
str1 = "He's name is Dan. He is an honest man."
print(str1.find("is"))
print(str1.find("Daniel"))
# index() method searches for the first occurrence of the given value and returns the index where it is present. If given value is absent from the string then raise an exception.
str1 = "He's name is Dan. Dan is an honest man."
print(str1.index("Dan"))
# print(str1.index("Daniel")) # this will show a value error
# isalnum() method returns True only if the entire string only consists of A-Z, a-z, 0-9. If any other characters or punctuations are present, then it returns false.
str1 = "WelcometoTheConsole"
print(str1.isalnum())
# isalpha() method returns True only if the entire string only consists of A-Z, a-z. If any other characters or punctuations or numbers(0-9) are present, then it returns false.
str1 = "Welcome"
print(str1.isalpha())
# islower() method returns True if all the characters in the string are lower case, else it returns false.
str1 = "hello world"
print(str1.islower())
# isprintable() method returns True if all the values within given string are printable, if not, then return False.
str1 = "We wish you a Merry Christmas"
print(str1.isprintable())
str1 = "We wish you a Merry Christmas
"
print(str1.isprintable()) # this will return False
# isspace() method returns True only and only if the string contains white spaces, else returns False.
str1 = " " # using spacebar
print(str1.isspace())
str2 = " " # using Tab
print(str1.isspace())
# istitle() method returns True only if the first letter of each word of the string is capitalized, else it returns False
str1 = "World Health Organization"
print(str1.istitle())
str2 = "To kill a Mocking bird"
print(str2.istitle())
# isupper() method returns Ture if all the characters in the string are upper case, else it returns False.
str1 = "WORLD HEALTH ORGANIZATION"
print(str1.isupper())
# startswith() method checks if the string starts with a given value. If yes then return True, else return False.
str1 = "Python is a Interpreted Language"
print(str1.startswith("Python"))
# swapcase() method changes the character casing of the string. Upper case are converted to lower case and lower case to upper case.
str1 = "Python is a Interpreted Language"
print(str1.swapcase())
# title() method capitalizes first letter of each word within the string
str1 = "He's name is Dan. Dan is an honest man"
print(str1.title())
Your way of teaching is just awesome
this is day 2 of my python journey and today i completed 13 days of content in this serise...
Thank you so much Harry Bro for the knowledge you are sharing❤
Great teaching done by you. Full hats off to you
Thank You sir for this course.
Bhaiya blockchain ke uper series ka intezar hai
Love youuuuuuuuuuuu❤❤❤❤
better than money hiest series...😂😂
#day-13
vikash dhakad
present sir
bhai breaking bad dekh
Bhai ak number notes or satting hai 👌👌❤
♥♥♥♥it is the ** first time when I stood constant with any series on youtube Salute to Harry bhai...
Thanks harry bahi Thanks ♥♥♥♥
bro "constant" nahi 'consistence" hota hai
11:00
Output of the code = ar
nm ="Harry"
print(nm[-4:-2])
Output - ar
Reason:
print (nm[-4:-2]) = print (nm[nm(len)-4:nm(len)-2]) =print (nm[1:3])
Here it would print index assigned from 1 to 3 but not including index 3 . Will print till index 2
str = "This is day 12 of thie series was completed!"
str = str.replace("12", "13")
print(str)
Moj Kara di londay...
Clever!!
free code camp se smja man ebut clear nhe ho paya but harry bhai kamal ha awesome smj arhe ha or mza bhe end ka araha ha dil krta ha foran next next kro
Present on #Day13 (11-Dec-22). Harry bhai you're really taking this course on a next level! Your older tutorials didn't contain so many methods. Thank you for your efforts.
Hey buddy. Did you finish that course??
@@aadisingh8742 yeah but now heavily burdened due to studies
@@arpankarmakar16 what are you doing currently
@@arpankarmakar16 did you get any benigit from that course. ?
@@aadisingh8742 yeah learnt a lot of new things from that course and also made a few custom projects, but nowadays I've to focus on studies more because of my poor grades
Mja aa gya ch-#12 tkk kuch khas smjh nhi aaya tha lekin ye chapter/session-#13 ache se smjh aaya.
Alhamdullilah in day 13 in one day.Insha Allah I will finish it in one week
#HarryBhai 😎😎 A bhi khatam hogeya bhai,,, Main kitana genius huan dekha Apane🤣🤣
Harry Bhai is an inspiration ❤
center method will add the blank spaces on both side of string
str1 = "Welcome to the Console!!!"
print(len(str1))
print(len(str1.center(50)))
o=str1.center(50)
print("start:",o[0:12])
print("End :",o[37:50])
print(o[12:38])
print(str1.center(50))
Output:
25
50
start:
End :
Welcome to the Console!!!
Welcome to the Console!!!
Hr string ko str1 k equal rkha tha mean hr string ka name same tha phir b error ni aaya q
pyhton mein ovverride kr sKTE hai variables ko is lie nhi aya
you are the best teacher to whome every one can conect
Amazing Video learnt alott and enjoy alott 🔥🔥
bhai is video me aap bht jyada fast ho gye aur kai chije jaldbazi me bata diya bina better explanation ke
i m beginer nd is video me lgbhag sbkuch sir ke upar se chala gya mere
Harry me to yeh mobile pet kar Raha hu 😢
Same. Don't worry just don't stop
@@SupreemeSteeveekitny lectures tak mobile mein kr skty hain or ap kahan tak pohanchy o
Me be Mobile ma karraha hu but no problem 😊
@@ahsanraza7199 complete
@@ahsanraza7199u can do everything in a mobile
istitle( ) at 18:10
a ="The Empire " #in this string 1st / staring word is capital then also why it returning "False "
100 days of python series >> any netflix series
Please make revision video every week to revise topic because I'm learning programing and face problem that i forget
"Harry">>>>>>>>>>>>>>"Hello World" 🤣😂
😂
koi rahe na rahe
i will be till end of 100 days
salute to your efforts
Kon kon 2024 mein start karra hai
me apka kitna hua or practice kasa ker reha
me
One correction is that capitalize method converts all other characters to lowercase, regardless of whether the first character was initially uppercase or not.
day 13 at the day1 only
done day# 14
title method is most important methon ye str me likhe charc ke first letter ko upper case me convert kardeta h
istitle method check karta h ki char lower case me h ya nhi
isupper method me check karta h ki char upper case me h ya nhi
i am also using macbook m2 and it is very good for coding and editing 😍
12:47 python insaan nhi naa ki snake bhi nhi hai that line is 🔥
thnks for your efforts for making this useful videos watching python videos here regularly .i am doing mca from ip .and again thnks for your hrd work dude
Harry bhai i am late because my semester exam is going on but I daily see your video because you are best teacher who teach us python easily .
# STRING ARE IMPUTIABLE
a = "yash!!!!"
print(len(a))
# UPPER CASE METHOD
print(a.upper()) # SO IN THIS WE CAN CHANGE THE STRING IN CAPITAL LETTER
#LOWER CASE METHOD
print(a.lower()) # SO THIS IS LOWER CASE METHOD .
# RSTRIP METHOD
print(a.rstrip("!")) # SO RSTRIP METHOD REMOVE ONLY ENDING STRIPS LIKE "!" FROM STRING .
# THIS METHOD NOT REMOVE STARTING STRIP LIKE "!!YASH" SO THIS OUTPUT IS : !!YASH
# REPLACE METHOD
print(a.replace("yash!!!!","harry bhai "))
# CAPITALIZE METHOD
harry="good teAcher"
print(harry.capitalize()) # SO THIS METHOD CONVERT 1ST LATER IN CAPITAL LETTER IN OUR LINE
# BUT THIS METHOD CONVERT ALL LETTERS IN SMALL LETTER
# OUTPUT IS : Good teacher
# CENTER METHOD
print(len(harry)) #output is : 12
print(len(harry.center(50))) # AND THIS OUTPUT IS : 50
# COUNT METHOD
print(harry.count("good teacher ")) # SO THIS METHOD COUNT HOW MANY TIME good teacher REPEAT IN STRING . OUTPUT: 0
# FIND METHOD
print(harry.find("A"))
# SO THIS METHOD FIND INDEX OF A IN OUR STRING MEANS WHICH PLACE A IS STAY IN OUR STRING
# THIS METHOD TELL US LOCATION OF A IN OUR STRING WITH THE HELP OF NUMBER SO OUTPUT IS : 7
# ISLOWER METHOD :
print(harry.islower()) # SO OUTPUT IS : FALSE BECAUSE OUR ALL STRING LETTER IS NOT IN LOWER SO OUTPUT IS FALSE .
# ISSPACE METHOD :
print(harry.isspace()) # SO THIS METHOD RETURN FALSE BECAUSE IN OUR STRING DO NOT HAVE ANY WHITE SPACE
# SWAPCASE METHOD:
print(harry.swapcase()) # THIS METHOD CONVERT LOWER CASE TO UPPER AND UPPER TO LOWER STRING OUTPUT IS : GOOD TEaCHER
# TITLE METHOD :
print (harry.title()) #output is : Good Teacher means it convert all string 1st letter in capital.
thanku harry sir for your important and learning books
waah how video editing is working nice to hear that one line
Please explain that will make u unique and everyone also like
It's so good Harry bhai ❤️❤️❤️❤️❤️💫I try to make my self as you
bhai bahut mazza aa raha hai........................................
Present harry bhai.. 3rd day of your course and on lec 13
It is is 'Cmd + /' for VS code in Mac.
Bhiya How much you are doing for Us that is such so caring❤❤We love you and your work.
You are great Harry Bro 😍
love from Pakistan🟢
len-finds the length of the string
upper-capitalizes each letter of the string into upper case
lower-coverts all the characters of the string into lower case
capitalize- capitalizes only 1st letter of the string & turned rest of the letter into lower case
isupper-Returns True if all the characters of the string r in upper case
islower-Returns True if all the characters of the string r in lower case
title-Capitalizes each 1st letter of the string into upper case
istitle-Returns True if each 1st letter of the string r in upper case
isalpha- returns True if the characters of the string contains A-Z or a-z , if there is any special symbols, punctuations etc then it returns false.
isalnum- returns True if the characters of the string contains A-Z or a-z or 0-9 , if there is any special symbols, punctuations etc then it returns false.
isprintable-returns True if the characters of the string r printable,else it returns false.
isspace-returns True if the string contains white spaces,else it returns false.
startswith-returns True if the string starts with the given value,else it returns false.
endswith- returns True if the string ends with the given value.
split()- converts the string into the list
center()-Aligns the string into the centre as per the argument given.
index()-searches for the first occurrence of the given value & returns the index number where it is present.
find()-finds the 1st occurrence of the given value & returns the index number if it is not present it returns -1.
swapcase()-Coverts the uppercase of the string into lower case & vice-versa
count()-counts the occurrence of the given value in the string
rstrip()-strips the given value from the right side of the string lstrip()-strips the given value from the left side of the string
replace("existing val","new val")- replace the existing value with the new given value
Thank you everything bhaiya dil se
thanks harry bhai for course. mjja to bhut aa rh hai bhai.
ভাই 💥💥💥💥
সেরা ব্রাদার❤
Love you Harry bro❣
From Bangladesh💞
I just started watching your video after 04 minutes of getting uploaded on YT .
Day-13 Present Harry Bhai
7:56 Does python only support US English, because when I tried centre() command it showed error while center() was working fine?
jordar courese ho raha he harry bhai
in addition to rstrip there we can use lstrp("") which remove left character and strip() which remove both left and right side character
Harry bhai bhot bdiya video h, Bss agr in methods ki time complexity v bata dete to maza ajata
great yrr fork wala kaam bohtt kaam aya
8:40 it does not take 25 spaces but 50 spaces as mentioned in center method, you are taking the length of spaces with str1
a=super harry Bhai
Print("a")upper
SUPER HARRY BHAI
very interting 👍👍👍👍👍👍👍👍👍
That its Awesome on one video Haris Ali Khan cover all methods in python string
congratulations for 6 million Harry Bhai .
bhaiya using lstrip we can also remove starting exclamatory mark
and using strip we can remove both side
#testing immutablity of strings
f = 'dadadada'
print(f)
f = f.upper()
print(f)
maza aaya harry bhai aapke saath thodi unofficial bate karke.
Hello sir, Es video me to aap ne 2x speed se padhaya.🥰
Anyway a lot of love from Peshawar , Pakistan.
Bhaiya everything was good but u misspelled one thing that, when we use center cmd let's say here its 50 so for 25 character there will be 12 leading spaces and 13 trailing spaces instead of all 25 leading spaces, remaining everything was fire thank youu so much!!
Edit:- I identified it while i was using :
st1="Welcome to the Console!!!"
print(st1.center(50,".")) # Here if we don't want spaces but this(.) we can use the following cmd
terminal=> ............Welcome to the Console!!!.............
Ossum teacher in this whole world....
Intresting Series😍
Feeling strong and determined. Thanks for this series