From the course: Python for Students (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Strings

Strings

- [Narrator] A really important part of programming is displaying text. You think about a cellphone there is text all over, whether its text messages, or the names of apps, or the alerts that pop up instructing you to do something. Whenever you need to work with anything that has to do with sentences, or words in Python we'll use something called a string. For this example, we are going to create a file called strings.py and type our code in the idle code editor. Strings are just a list of characters in Python. For example this is a string, you can use double quotes or single quotes. You can also use triple quotes, if your string is going to span multiple lines. For example, This is an example of a string that spans multiple lines, and Python can handle it by using a triple quote. Generally using a single or double quote is a matter of personal preference. However if the characters that you want to display includes…

Contents