Strings in python code example
Example 1: how to create string in python
string = "this is string"
string = 'this is also string'
Example 2: pyhon string
my_string = 'Hello'
print(my_string)
my_string = "Hello"
print(my_string)
my_string = '''Hello'''
print(my_string)
my_string = """Hello, welcome to
the world of Python"""
print(my_string)
Example 3: print string python
str1 = "Hello World"
print(str1)
Example 4: string in python
string = "String"
string = str(string)
s1 = "Str"
s2 = "ing"
s = s1 + s2
Example 5: strings in python
myString = "Hello world"
print(myString)
myArr = []
myArr.append(myString)
H = myString[0]
lowercase = myString.lower()
myInt = int(myString)
Example 6: pyhon string
a = "Hello"
print(a)