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 :)
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:
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.
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!