How to Use Strings in Python - Python Tutorial for Beginners

未能成功加载,请稍后再试
0/0

So here we have this course variable set to Python programming.

As I told you before, whenever you work with text, you should surround your text with quotes.

You can either use double quotes or single quotes.

That's more of a personal preference, but quite often we use double quotes.

We also have triple quotes and we use them to format a long string.

For example, if you have, Let's say a variable message.

That is the message.

We want to include in the body of an email You can use triple quotes to format it like this Hi, John This is Marsh from code with marsh calm blah blah blah.

So that's when we use triple quotes Now we don't need this in this lecture.

So delete let me show you a few useful things you can do with strings First of all, we have this built-in function in Python for getting the length of strings.

下载全新《每日英语听力》客户端,查看完整内容