From the course: Programming Foundations: Beyond the Fundamentals
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Finding patterns in strings - Python Tutorial
From the course: Programming Foundations: Beyond the Fundamentals
Finding patterns in strings
- I can do a lot of things with an assembled set of blocks, even just a single row. I can change out certain blocks. I can remove or replace certain blocks. I can break the sequence apart at certain points. I can even pull it all apart into individual blocks. Most programming languages include tools that let us do similar things with strings and often a lot more. But when would we want to change the content of a string in our programs? Well, imagine writing a program that receives data that a user has typed into a form, for instance. The user enters first and last name and you want to add that to your database. But what if the user enters a name in all lowercase? Maybe you want to ensure that the first name and last name are capitalized. This is one place where string methods can be really useful. In the start file for this video, I've included a few variables. Notice that the first name isn't capitalized and neither is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.