Strings in Python

What is String in python?
  • In Python, String is a sequence of characters enclosed by either single quotes or double-quotes.
    • Example: 'Python', "Geek4Tutorial"
  • Strings are immutable.
  • Each value in a string is called character. 
Creating a String:
  • Strings can be created by enclosing the sequence of characters inside a single quote or double quote and assigning it to a variable.
Strings in Python
  • Sometimes triple quotes can also be used to create a string, even though triple quotes are used to represent Multiline strings and Docstrings.
Strings in Python
  • We can access the characters(element) in the string just like the index using index position.

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...