Python str Data Type:(PYTHON FUNDAMENTALS)

Created with Sketch.

str Data Type:

 

  •  str represents String data type.
  •  A String is a sequence of characters enclosed within single quotes or double
    quotes.
  •  s1=’Mohan’
  •  s1=”Mohan”
  •  By using single quotes or double quotes we cannot represent multi-line string
    literals.
  •  s1=”Mohan
    soft”
  • For this requirement we should go for triple single quotes(”’) or triple double
    quotes(“””)
  •  s1=”’Mohan
    soft”’
  •  s1=”””Mohan
    soft”””
  •  We can also use triple quotes to use single quote or double quote in our String.
  •  ”’ This is ” character”’
    ‘ This i ” Character ‘
  •  We can embed one string in another string
  •  ”’This “Python class very helpful” for java students”’

Leave a Reply

Your email address will not be published. Required fields are marked *