How to run Python program | Python String

Agenda of this session

How to run Python program | Python String

Python String

  • In Python, a string is a series of characters. Also, Python strings are immutable.
  • Use quotes, either single quotes or double quotes to create string literals.
  • Use the backslash character \ to escape quotes in strings.
  • Use raw strings r'...' to escape the backslash character.
  • Use f-strings to insert substitute variables in literal strings.
  • Place literal strings next to each other to concatenate them. And use the + operator to concatenate string variables.
  • Use the len() function to get the size of a string.
  • Use the str[n] to access the character at the position n of the string str.
  • Use slicing to extract a substring from a string.



We have our own LMS. SMARTLEARN is cloud based user-friendly Learning Management System. You will get 24 X 7 hours access by login with a unique username and password. The full course content has been uploaded in the LMS. Please Register with us. After registration you will get the login details.  Register Now