Creating strings

We can create strings in Python in three different ways:

  • Using a single quote
  • Using a double quote
  • Using a triple quote.

Have a look at the following example:

String1 = 'Creating a String with single Quotes.'
String2 = "Creating a String with double Quotes."
String3 = '''Creating a String with triple Quotes.'''
print(String1)
print(String2)
print(String3)

The output of all three print statements is the same. They create a string, as intended.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.107.193