From the course: Python for Non-Programmers
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Strings - Python Tutorial
From the course: Python for Non-Programmers
Strings
- [Instructor] Now that we've learned about two different number types, integers and floats, we're going to learn about a new type called strings. And strings are a way to represent text inside of Python. So I left some examples here to show both an integer and float, and let's talk about our new type which is string. So let's make a string variable that represents my shirt color. So I'm going to make a variable here called shirt, and I'm going to set this equal to a color. So my shirt is blue, so I'm going to say shirt is equal to blue. But you'll notice if I try and run our code here, I'm going to get a really nasty looking error that just says, hey, this thing, blue, it's not defined. And the problem is here, that in Python, whenever you want to represent a string or represent text, you have to put that text with some quotes around it. So for example, I'm just going to put some double quotes around the term blue here.…