In Episode 04 we talked about the Python Variables, Datatypes, and how to use them. So, in this post, I thought to explain Python strings (str). Normally strings are the text in Python. we can use them anywhere in our projects. These are some examples of it,
1. When you need to print a text
2. When you want to get a text input
3. When you want to get a special Character from a text
There are more, these are only a few from the usage of Python Strings. Now let's see how to make different String types in Python.
'Hello, www.softexs.com'
"Hello, www.softexs.com"
This is is how to make String data in Python. There is no " " or ' ' difference when making a sting but you can have a problem when making a string like this 'softexs.com's website'. in this String, we are using another single quote ( ' )inside the string.so Python this is as an incomplete string. so, you can avoid that kind of error using ("softexs.com's website") single quotes( ' ) inside the double quotes( " ).
This is the Problem;
Using Multiple lines inside a string
We talk about how we are using print() statements to display a value in Python. Also, you can make a variable that is assigned to a string. If you don't have good knowledge about variables, you can refer the Episode 04. But how you use few lines in your stings. because " " or ' ' quotes we talked are not supporting to multiple lines, Well you can use this method to avoid that problem.
and technology News website. You can
also learn programming n this website'''
You can use (''' ''') triple quotes to write multiple lines in Python.
This is the Problem;