Python is an open-source (free) programming language that is used in web programming, data science, artificial intelligence, and many scientific applications. Learning Python allows the programmer to focus on solving problems, rather than focusing on syntax.
In this tutorial you will learn to create, format, modify and delete strings in Python. Also, you will be introduced to various string operations and functions.
What is String in Python?
A string is a sequence of characters(Collection Of Character)
A character is simply a symbol. For example, the English language has 26 characters.
Computers do not deal with characters, they deal with numbers (binary). Even though you may see characters on your screen, internally it is stored and manipulated as a combination of 0's and 1's.
How to create a string in Python?
Strings can be created by enclosing characters inside a single quote or double-quotes. Even triple quotes can be used in Python but generally used to represent multi line strings and doc strings.
Python Program for String
#Creating a String With Single quotes
String1 = 'Welcome to the engineer World'
print("String with the use of Single Quotes: ")
print(String1)
#Creating A String With Double Quotes..
String1 = "I'm a abdul kadir khan"
print("\nString with the use of Double Quotes: ")
print(String1)
#Creating a String With Triple Quote
String1 = '''I'm a abdul kadir khan and I live in a world of "engineer"'''
print("\n String with the use of Triple Quotes: ")
print(String1)
# Creating String with triple Quotes allow multiple line
String1 = ''' Software
engineer
acadmy'''
print("\nCreating a multiline String: ")
print(String1)