Python) String

강현상
Jun 28, 2021

--

Everything that you write inside ‘’, or “”, those are all to be categorized into strings

Can declare string like numbers, and can add different strings to one like:

setting string example

If you want to include a quotation mark or double-quotation mark, you can put a backslash(\) before ‘, or “

To change the line, you use \n:

changing line example

_________________________________________________________________

Indexing and Slicing

Indexing helps you to find which letter is in the nth position by using []: a

Indexing example

By using this technique, you can also use slicing

Slicing is to pull out a part from a sentence:

slicing example

--

--