String can be expressed in several ways: enclosed in single quotes or double quotes : String Declaration « String « Python






String can be expressed in several ways: enclosed in single quotes or double quotes

String can be expressed in several ways: enclosed in single quotes or double quotes
 

 

print 'spam eggs'

print 'doesn\'t'

print "doesn't"

print '"Yes," he said.'

print "\"Yes,\" he said."

print '"Isn\'t," she said.'

           
         
  








Related examples in the same category

1.Demonstrates creating new strings with a for loop
2.String literals span multiple lines in several ways.String literals span multiple lines in several ways.