xxxxxxxxxx
#you can start a multiline string with either ''' or """
'''This is a
multiline
string.'''
"""It can be used as a
multiline comment
too."""
xxxxxxxxxx
#You can assign a multiline string to a variable by using three quotes:
#we use it when we want to assign many lines in a variable in python
multiline_strings = """python is amazing ,
we can use it for many tasks ,
python is famous because python was not made to solve any kind of problem we
use it for many tasks , and this is how you declare multiline strigs """
print(multiline_strings
xxxxxxxxxx
s = """ this is a very
long string if I had the
energy to type more and more """
xxxxxxxxxx
#you can use """ or '''
multi_line_string = '''
This is a
multiline string'''
print(multi_line_string)
#or you can use "\n"
multi_line_string = "This is a\nmultiline string"
print(multi_line_string)
#or u can use package "textwrap" module
import textwrap
long_string = "This is a very long string that needs to be wrapped to fit a specific width"
wrapped_string = textwrap.fill(long_string, width=30)
print(wrapped_string)
#just choose one dont run this code all at once
xxxxxxxxxx
"""You can
use both
double quotes
"""
'''And
singel
quotes
'''
# in a normal string this will be displayed as
# And\nsingel\nquotes\n