Strings in python 3.

Strings in python 3.

Here, we will learn about strings in python3 and how to use them in less than 2 mins. There's a small test at the end too :)

·

1 min read

Welcome to Python 3 ! Have fun :)

day 1

Strings:

We can create a string by entering text between two single or double quotation marks. Like this:

Screen Shot 2022-03-31 at 22.26.06.png

But what if you want to include a single quote in a single-quoted string (or a double quote in a double-quoted string)? Normally this would confuse Python and break the code, that is unless you escape the quotes using a backslash.

Screen Shot 2022-03-31 at 22.28.20.png

That's all for strings.. Now, let's take a little test...

Guess which of the following is a string?

1) 4.4

2) 4

3) '4.4'

COMMENT YOUR ANSWER! goodluck! :)

Many other python 3 beginner tutorials will be posted soon.. stay tuned Coders!