From the course: Programming Foundations: Fundamentals
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Working with strings - Python Tutorial
From the course: Programming Foundations: Fundamentals
Working with strings
- Let's talk about strings. In programming, whenever we have to deal with text, be it an email address, someone's name, or even an emoji, we use strings. The name comes from the fact that it's a string of characters one after the other. The characters can be letters, numbers, symbols, and even spaces. They're typically represented by beginning and ending quotes. Strings can be passed directly to functions or they can be stored in variables. For example, we can use the print function in Python to display a message on the screen, like, "Hi, there!" Notice that we have the opening and closing double quotes. These let Python know it should print out the characters in between the quotes just as we've typed them. We could also define a variable which contains the same string and we'd get the same result. In fact, with Python, we could use single quotes to create a string as well. But you might be wondering why would I want…
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.
Contents
-
-
-
-
-
Introduction to variables and data types3m 37s
-
(Locked)
Variables across languages3m 27s
-
(Locked)
Working with numbers4m 48s
-
(Locked)
Working with strings2m 29s
-
(Locked)
Properly using whitespace4m 22s
-
(Locked)
Working with comments3m 26s
-
(Locked)
Challenge: What's the output?49s
-
(Locked)
Solution: What's the output?5m 14s
-
-
-
-
-