Python language basics 14: string basics
May 23, 2015 Leave a comment
Introduction
You can think of a string as being a text. It is a combination of characters like “a” or “h”. Characters can just as well be non-Latin ones of course such as Greek, Cyrillic, Chinese or Japanese characters. Characters that make up a word, a sentence or a whole book are all examples of strings.
Creating strings in Python
There are various ways to create strings in Python. We’ve already seen some examples in this series. You just put the string within single or double quotes and you’ve constructed a string:
myString = "hello world, this is Python calling" myOtherString = 'hello world, this is Python calling'