Viewers: in countries Watching now:
Due to its power, simplicity, and complete object model, Python has become the scripting language of choice for many large organizations, including Google, Yahoo, and IBM. In Python 3 Essential Training, Bill Weinman demonstrates how to use Python 3 to create well-designed scripts and maintain existing projects. This course covers the basics of the language syntax and usage, as well as advanced features such as objects, generators, and exceptions. Example projects include a normalized database interface and a complete working CRUD application. Exercise files accompany the course.
Python has an extremely rich set of string methods, over 40 of them last I counted. What we've covered here are the essential ones. And I'd like show you how to find the rest of them and how to use them. It's really quite straightforward. Here we have the Python documentation page or the Python Standard Library. And we'll notice this is section 5, Built-in Types. And down here we see this link of 5.6.1 String Methods. And here's a complete list of all the string methods. Like for example, here is this center one.
And we see that center it takes with and an optional fill character and it returns a centered string of length width. And padding is done using this specified fill character. Default is a space. So if I had a string, 'this is a string', and I wanted to center it on say 80 character string, I would simply say new = s.center(80) like that. And now I have a new string. And we see that this new string is 80 characters wide. I can check if I want to. length of new is 80.
And we see that the string from my original string is centered there. Like I said, there are over 40 of these different methods. And here's the entire list and they are all very well documented. It's really simple. It's not in a terribly technical language. And so I encourage you to take the time and at least read through this one and get an idea for what is available. And then refer to it when you need one. That makes it really easy for you to have these tools at your disposal without having to memorize everything, without having to go through a lot of detail on the ones that you are not going to use very often.
So use the documentation in this case. There is a great wealth of string methods available. And I encourage you to become familiar with them and use them.
Find answers to the most frequently asked questions about Python 3 Essential Training .
Here are the FAQs that matched your search "" :
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.