String Methods in Python | Python Tutorial – Day #13
- May 28, 2024
- Posted by: MainInstructor
- Category: JavaScript Python
![*](https://i0.wp.com/allprowebdesigns.com/wp-content/uploads/2024/05/1716871432_maxresdefault.jpg?resize=840%2C430&ssl=1)
Video Title: String Methods in Python | Python Tutorial – Day #13
This 100 Days Of Code series is doing just like Netflix People are excited for this just like a TV series It’s quite fun! In today’s video we’ll talk about ‘String’ methods We already have studied about ‘Strings’ We learned "What ‘String’ is" And "It is quite important ‘Data Type’ " And we also had a look on the ways of creating a ‘String’ Today I’ll tell you how you can do operations with a ‘String’ For eg. Let’s suppose you want to convert a ‘String’ in Uppercase Or you want to convert a ‘String’ in lowercase which is written in Uppercase Or you want to find out the length of a string so how you can do that? I’ll tell you all this in this video Lets move to the computer screen and let’s get started [ [S [ST [STA [STAR [START [STARTI [STARTIN [STARTING [STARTING [STARTING T [STARTING TH [STARTING THE [STARTING THEM [STARTING THEME [STARTING THEME] So as You can see I’ve opened my Repl And if you haven’t accessed the play-list so make sure to do it Bookmark it by clicking here And save it by clicking here Today we’ll learn about some methods of ‘Strings’ Let’s suppose I’ve written here ‘ a = "harry" ‘ This the ‘String’ of len 5, we all know this In the preceding video we learned, this is how we can print the len(a) There’s no big deal in that, we got 5. But what should I do if I want to convert this string into uppercase? The first thing I want to explain you is, "Concept of immutability" This is I want to explain you first ‘Strings’ are immutable Which means you cannot change them But you can change them, It’s not about, you can’t change them at all But you cannot change them ‘in-place’ Let me explain Let’s suppose I’ve ‘ a = "Harry" ‘ So I cannot change variable ‘a’ as it is It is what it is I can make a copy of it So whenever I apply any method related to ‘Strings’ For eg. let’s suppose if I write here "print(a.upper)" So I’ll get a new ‘String’ I’ll get a new ‘String’ in which all the letters… …Will be of uppercase As you can see I’ve got "HARRY" in capital letters It’s not like the old ‘String’ has been changed So this is the question they ask in interviews That’s why I’m telling you That " ‘Strings’ are immutable " Let me write this here for reminding you "Strings are immutable" "Strings are immutable" And obviously I’ll change it to a comment I’ll make it a comment with the help of ( Ctrl + / ) So that it won’t be executed Because if this gets executed, so it’ll throw an error And I don’t want it to throw error OK! Good! As I told you about ‘Upper’ method just like that there’s ‘Lower’ method Which converts our ‘String’… …Into lowercase And it is very obvious "The ‘lower()’ method converts string to lower case." And I also have given an example here if you want to try this out Will this example convert this ‘String-1’ into lowercase? Do you know the answer to this question? "No! It won’t" Why? Because it’ll create a new ‘String’ It won’t change the existing ‘String’ "Strings are immutable in Python" You can’t change them But you definitely can create a new ‘String’ using ‘String Methods’ What do ‘String Methods’ do? They operates on you existing ‘String’ and return a new ‘String’ We learned this… (a.upper) & (a.lower) What will (a.lower) do? It’ll convert whole ‘String’ "Harry" into lowercase Great! Now there’s a method with name "rstrip" Which removes the trailing characters Let’s suppose if I had written my name like "Harry!!!!!!!" So if I prints (a.upper) or (a.lower) Or if I print(a) for that matter So I’ll directly get my ‘String’ as it is But I want these exclamation marks to be stripped So I’ll write (a.rstrip) What does it do? It strips…. …Trailing characters So I can strip exclamation marks like this So look here….. These marks has been striped Does it strip leading exclamation marks? The answer is "No" Exclamation mark will stay on the starting So it just strip trailing characters So we learned this…. So I’ll leave this "Harry!!!!!!!" as it is so that you can understand about ‘rstrips’ briefly Now let’s talk about ‘replace’ What does it do? "Replaces all occurrences of a string with another string." Let’s suppose I want to replace "harry" with "John" So I’ll write "print(a.replace("harry", "John")) Replace "Harry" with what? And obviously I’ll write this in double-quotes(" ") Replace all the occurrences of "Harry"… …With… …"John" So now if I prints it, so the ‘String’ will be printed as it is except "Harry" which will be replaced by "John" As you can see here…. What if there were multiple "Harry"? Would all those also change? Yes! As here it is written "all occurrences" so all the "Harry" will be changed to "John" (a.replace("Harry")) all "Harry" have changed to "John" So this is it Now "What does ‘Split’ do?" ‘Split’ is a quite good method which converts… …Your ‘String’ into a ‘List’ Now we haven’t studied much about ‘List’ yet So I won’t talk about this method for too long But I will just show you… If I…. ….Split Split with a ‘Space’ And my ‘String’ must contains ‘Spaces’ only then the ‘Split’ will work So this will be the first element of ‘String’ and this will be the second element of ‘String’ If there’s another ‘space’ so that will be the third element of ‘String’ Which means a list of this, this & this will be created So let me tell you how this works If I run this so a list will be created Which will contain "!!!Harry!!" , "!!!!!!" and then "Harry" What is ‘List’? I’ll tell you soon & very clearly We’ll also have a look on methods of ‘List’ ‘Capitalized’ method is…. In JavaScript…. Yes I’m talking about JavaScript ‘Capitalized’ method is not in JavaScript ‘Capitalized’ method is quite useful when you’re writing Blogs I remember when I was writing my Blog for "CodeWithHarry.com" in Python Django So at that time this was quite useful to me when I had to capitalize the first character Which means I want to display the first character as capital For eg. let’s take the heading of my Blog Let me take realistic example so that it’ll be easy for you to understand "introduction to js" let’s suppose this is my heading Now I want to capitalize this heading Now you’ll say "just correct the spelling yourself what’s the need to capitalize it?" So what happens is… We sometime forget to write in capital We usually write like this in a hurry So if I’ve written the heading of Blog like this in a hurry So I want this heading’s first character… …to be converted in uppercase So I’ll write "print(blogHeading.capitalize)" And when I’ll run this so the first character of my blog will be converted into capital And my Blog will look good So look "Introduction to js" it’s first letter is in capital now Which looks quite great So this is how you can do it Now look…. If I write the same thing like this…. Let’s suppose if someone has made a mistake He has write it as "tO" and this mistake is quite common when you’re publishing 2-3 Blogs daily So often this human error occurred And let’s suppose if you’ve written it like this…. "jS" When you’ll run this… So ‘Capitalize’ will automatically correct it and look it has turned them all into lowercase Now if you move to here and have a look on the description of Capitalize method So you’ll see "The capitalize() method turns only the first character of the string to uppercase" It’ll convert the first character into uppercase But it’ll convert all the other characters into lowercase "The string has no effect if the first character is already uppercase" Which is so obvious And if your first letter is already an uppercase so what can it do? When everything is correct so ‘Capitalize’ takes no effects But this is how it works Now there comes ‘Center’ method it aligns the string to the center As per the parameter given So I’ll use the same example as here And I’ll run this… And when it started printing "Welcome to the console" it automatically added 50 ‘spaces’ in the starting Now let me sow you one thing I’ll do " print(len(str1.center(50))) " And I’ll do " print(len(str1)) " And if I run it…. So look, Length of (str1) is 25 and length of (str1.center(50)) is 50 So what this center do is… The length of string was 25 and it added 25 spaces in starting so that it’ll be aligned to the center So this is how ‘Center’ method works And I also have written the description Now we’ll move forward and talk about "count" What ‘Count’ method does is… It tells which character is occurring how many times in the string For eg. "Harry" is occurring twice here So if I want to count how many times "Harry" is occurring in my string So I can print it like…. I’ll write "print(a.count("Harry")) " Tell me how many times "Harry" is occurring in string ‘a’ It is occurring twice so look, it has printed 2 So this is how ‘Count’ method works And then ‘endswith()’ function is quite useful With this method we can find if a string is ending with given character/set of character Let me show you… And I’ll use the same example as here I’ll copy and paste this example and let me show you The biggest advantage of using Replit is, that I’ve written tutorial directly here and you can practice it So Ideally what you have to do is…. Let me tell you because this is the FAQ You firstly have to fork my Repl And after you fork it, you’ll be able to run it And you’ll see this interface If you access this Repl directly so you won’t see this interface You have to ‘Fork’ the Repl Let me show you because it is very important I’ve to this because this is very important I’m interrupting this lecture for a sec And I want to show you So if you visit "replit.com/codewithharry" And I’ve write it like "replit.com/@codewithharry" If yo visit "replit.com/@codewithharry" So for example this is my Repl So what you’ve to do is, you’ve to click on "Fork Repl" And when you’ll click on "Fork Repl" so you’ll see this interface I’m unable to see this interface because I’m not logged in But you’ll see this interface So basically happens is.. that a copy of my Repl is created for you And you can edit it as you please So I want to tell you this because it is very important So by doing " print(str1.endswith(!!!)) " It’ll tell if this string is ending with this or not So it is ending with this… So I got ‘True’ as output It’ll return this me as a ‘Boolean’ ‘Data Type’ I can use ‘Boolean’ ‘Data Type’ in (If/Else) Which I’ll explain in the upcoming lecture So this is how we can use "endswith()" So look " We can even also check for a value in-between the string by providing start and end index positions. " I can even tell if this string is ending with "To" between character 4 and 10 Do you understand what this means? Let me explain you Look, if I do slicing of this string And if I search from 4 to 10 so what will I get? 0…1…2…3… And I’ll get the text I’ve highlighted I’ll get "ome to" So is this string ending with "to" ? Yes! It is ending with "to" so I’ll get "True" as output So look if I run this… And BTW for you information let me tell you that I can over-write a variable In Python Programming like this So I’ve got ‘True’ here So this is how it works Now let’s talk about ‘Find’ methods ‘Find’ method is a quite simple method which search for the first occurrences of the given value And it returns the index where it is present So I’d like to tell you, if it is unable to find the string you’re looking for So it returns "-1" You won’t get it like this, so let me give you an example So look here’s a man with name "Dan" "He’s name is Dan" is written here "He is an honest man" Now you’ll say "Why have you written ‘He’s name is…’ " Let me tell you It won’t detect this But it will detect this In-fact it’ll detect this because this is the first occurrence So let me show you if we use ‘Find()’ method so I’ll get it’s index 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 I should get output " 10 " And I’m getting output " 10 " So it’ll return me the index of the first occurrence of "is" So if I do " print(str1.find("is")) " so it’ll return me the index of first occurrence of "is" It won’t show this or this… because this is not "is" and Python don’t know, because Python is not a human Python is not a human or Snake Python is an… interpreter or a computer So it can compute… It cannot detect that "He’s" also means "He is " So it’ll give me the index where it’ll literally find first "is" Now the next method I want to mention is "Index" method, What is it? Index method is basically same… in-fact it is quite similar to "Find" method But what ‘Find’ does is… It return "-1" If I search for "ishh" so it’ll return "-1" Because there’s no occurrence of "ishh" so it’ll return "-1" But if I copy this and change this with "index" So an exception will be raised And I’ll get an error So maybe if we’re so sure in our program to find something so we’ll use this method But if we want our program to exit after giving an error if it’s unable to find this SO we’ll use ‘index’ method So ‘Index’ method raise an exception "ValueError: substring not found" so this is the error it raise And then comes the next method ‘isalnum()’ to find if your string is alpha numerical or not "The isalnum() returns True only if the entire string only consists of A-Z, a-z, 0-9." These are the alpha numeric characters "If any other characters or punctuations are present, then it returns False. As you can see if I run it… "Welcome to the console" Yes! Let me comment his out because it is throwing error I’ll comment this out because there is no occurrence of "ishh" There is no occurrence of "ishh" so it is throwing error So look it is an alpha numeric string so the output is ‘True’ Alpha numeric means an ‘String’ made up of "A-Z, a-z, 0-9" these character And then comes "isalpha" but it doesn’t contains numbers unlike "isalnum" "isalpha" will return ‘True’ if your ‘string’ consist "A-Z or a-z" Else it’ll return ‘False’ This time I’ll give you example with "Welcome00" if it returns ‘False’ or not Now if I check for "welcome00" so it’ll return ‘False’ but earlier it was returning ‘True’ I hope I’m not explaining this very fast So look the output is ‘False’ But if I remove these double-zero(00) So ‘True’ will be returned in place of ‘False’ And try this on your own If you don’t so there won’t be any clarity Then comes ‘islower’ to check if all the characters are of lowercase or not If yes, it’ll return ‘True’ or else ‘False’ So look, you’ve got this Repl and you know that you’ll get this interface when you’ll fork it You can place it wherever you want like this This navigation is so smooth That’s why I’ve choose Replit for this course Because it is fun Here appears the tutorial and here Floating video I don’t think we can find better experience than this as of now Then ‘isprintable’ is the next method Try ‘islower’ if it is made up of lowercase so it’ll return ‘true’ Or if I there’s any uppercase character so it’ll return ‘False’ I’ll press ( Ctrl + Z ) and this will be returned to ‘True’ As you can see Now what is ‘isprintable()’ "The isprintable() method returns ‘True’ if all the values within the given strings are printable" Otherwise it returns ‘False’ So it’ll return ‘True’ if character is printable or else ‘False’ I just want to show you the printable characters and all these characters are printable so it’ll return ‘True’ But if I add a carriage return back-slash(n) So it’ll return ‘False’ Because this is not a printable character you won’t be able to see back-slash(n) So that why ‘False’…. If I print… …str1 So you won’t be able to see back-slash(n) You’ll literally get the new line printed back-slash(n) is not one of printable characters So I hope you understood this Now I’ll tell you about ‘isspace()’ method "This returns ‘True’ only and only if the string contains white spaces Otherwise it returns ‘False’ So if we’ve added white spaces using space-bar So you’ll ‘True’ in return So look I’ve added spaces with space-bar like this And it is returning ‘True’ Even if I use ‘Tab’ key for spaces they’ll be count as ‘white spaces’ So are there spaces present? Yes there are! So it is returning ‘True’ True True I hope you got this Now there’s a method ‘istitle()’ which returns ‘True’ only if the first letter of each word of the string is capitalized Else it returns ‘False’ So what can we do? I remember I used this method in my Django Blog when I…. …had to capitalize all the titles of my Blog And if there’s a character which is not capital so I can find that in my dashboard So I can do that… If I run this… So my iPhone is also telling me that I only got 20% battery level Please finish the video quickly BTW many of you wants to know that how am I recording? So I use ‘continuity camera’ of iPhone Because I was getting too much messages about this, that’s why I’m telling you this It’s quite great… So I’ll talk about this in the end of video so that no one’s time get wasted Let me finish this title quickly "To kill a Mocking bird" I have to check if this falls under ‘istitle’ or not So I can do that in this way And look… "To kill a Mocking bird" "False" Now what does ‘isupper’ do? Exactly as ‘islower’ Now the next method is ‘startswith()’ Which is exactly like ‘endswith’ If your string is starting with the given character so it’ll return ‘True’ So look the output will be ‘True’ because it is starting with ‘True’ Now the next method is ‘swapcase()’ which swaps the uppercase to lowercase and vice-versa A very straight forward method, try to run & practice it ‘swapcase()’ So look it has swap all the case It has swapped uppercase to lower and vice-versa Now there’s a ‘title()’ method which converts it to a ‘titlecase’ Look what’s happening is… when I’ll run it… So "He’s name is Dan" Let me change this to ‘His’ "His name is Dan" "And Dan is an honest man" Now all the first characters will be tuned to uppercase just like ‘I’ & ‘D’ So this is used usually in Blogs I hope you’ve understood this quite well And now for the ones who want to know about my recording set-up because I was getting too many questions And for the rest ones, we’ll meet in the video This is all about coding for now Now I’ll tell about my recording set-up The one who wants to.. will listen Rest of you can skip to next video, if any So look, what I do is… This is my MacBook I bought a MacBook recently To create videos I bought this because I was quite impress with the MacBook and I was using it in my work space and it impresses me quite a lot So I bought MacBook because I got used to it I often used to get confused while doing office work & personal work So I choose to stay on MacBook Is something wrong with Windows? No! It’s great And I recommend you to start with Windows Well we’ll leave these discussion for another video But I record with OBS And there’s a feature in your iPhone with name ‘Continuity Camera’ What it does is… Let me show you continuity camera If you own a MacBook and an iPhone So when you bring you iPhone closer to your MacBook and turn on it’s Bluetooth & Wi-fi So your iPhone can automatically be used as a Web-cam So look how good the quality is.. It is my iPhone So I tried it.. I also have got a camera maybe you can see, it’s behind me I can use it too, and I’ve a variety of lenses The quality can be improved But again I’m pretty satisfied with iPhone’s quality So I’ve mounted my iPhone here And the rest is too easy Now there are quite impressive things in it that you have the option for video effects So look if I choose the option ‘Center Image’ so look the image has moved to the center And if I click on ‘Portrait’ let me show you how am I doing this If you click here so you’ll get an option for ‘Video effects’ So there are 3 options let me show’em all The first one is already in use Now I’ve chosen the second one Now if I choose ‘Studio Light’ so the lighting is changing When I’ll use ‘Portrait’ so it’s get blurred But it is good enough, I think it shouldn’t blur this mic And if I move like this so this is good and it also has blurred the stand of mic So I know Apple will do improvement in this But… It’s quite great, and let me turn off these effects because I use them while post processing So I turned off these effects because I use them while post processing Then comes the ‘Desk view’ in this you’ll be able to see my desk Now you’re able to see my desk. Can you see it? So this is quite good, you’re able to see all the material of my desk This desk view is visible This is quite impressive Can you see which angle is it using? So let me close it for now And that’s all… I just have used this mic Which is quite great Normal mic was enough but I’ve upgraded this I hope you’re enjoying it When the quality is good, it’s fun watching videos That’s it for this video guys. Thank you so much guys for watching this video 🙂 And I’ll see you next time
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Instagram (for those who want to mention, I will try to mention everyone back): https://www.instagram.com/codewithharry/
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
Hello, @code with harry , could you please make AL FULL COURSE. It helps to learn new things, which is currently crucial to us for artificial intelligence. please as I request to you please please please..
@codewithharry
if 50 spaces were added then how is the total string length 50?
and if 25 spaces were added then why is the command (str1.centre(50)) and not (str1.centre(25))
5/23
Day 13 done ✅
thankyou sooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo much sir for upload this python tutorial love u a lot
day 13
100 days of python series >> any netflix series
Sir mereko ye samaj nhi aa raha hai ki print(a. Upper ( )) me adhar aur ak braket q dena porta hai lower aur , capitalize me bhi
Sir mereko ye samaj nhi aa raha hai ki print(a. Upper ( )) me adhar aur ak braket q dena porta hai lower aur , capitalize me bhi
Day 13 done
100 videos in a single on 8th day.
Exercise don calculator
Present
Welcome00 mera true aya hai
bhai in 14:28 if I give space in between isalnum then it shows false why so?
Nice
congratulations for 6 million Harry Bhai .
nm= "harry"
print(nm[-4:-2])
Output=ar
day 13
Present
harry bhai
Ans: ar
Day-13: Done
present