-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating String. Strings in Python can be created using single quotes or double quotes or even triple quotes
- Loading branch information
1 parent
efc5047
commit 7285cea
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |