Skip to content

Commit

Permalink
String
Browse files Browse the repository at this point in the history
Creating String.
Strings in Python can be created using single quotes or double quotes or even triple quotes
  • Loading branch information
mohd-mehraj authored Oct 6, 2020
1 parent efc5047 commit 7285cea
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Strings/String
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Python Program for
# Creation of String

# Creating a String
# with single Quotes
String1 = 'Welcome to the Geeks World'
print("String with the use of Single Quotes: ")
print(String1)

# Creating a String
# with double Quotes
String1 = "I'm a Geek"
print("\nString with the use of Double Quotes: ")
print(String1)

# Creating a String
# with triple Quotes
String1 = '''I'm a Geek and I live in a world of "Geeks"'''
print("\nString with the use of Triple Quotes: ")
print(String1)

# Creating String with triple
# Quotes allows multiple lines
String1 = '''Geeks
For
Life'''
print("\nCreating a multiline String: ")
print(String1)

0 comments on commit 7285cea

Please sign in to comment.