Hey Everyone,I am Vikram Salunke and welcome to Python for InfoSec.
This is part 5 and in this video we will see Strings.
So, basically strings are collections of characters.
Strings are either enclosed in with ' (single quotes) or " (double quotes).

for example

str1 = "abc"

str1

str2 = 'xyz'

str2

strings

In this example, we are defining string abc in " (double quotes) and xyz in ' (single quotes).
This will allow you to use quotes and apostrophes within strings.

for example

str = 'He said, "Python for InfoSec is one of the best course!"'

let's print this

print str

strings

To use a quotes we use " (double quotes) inside a ' (single quote)
let's see example of apostrophes

str2 = "It's nice to see you."

let's print this

print str2

In this example, we are using apostrophes.
to use the apostrophes we are using ' (single quote) inside a " (double quotes).

String Concatenation

Now let's see String Concatenation
let's define

first_name = "vikram"

let's define

last_name = "salunke"

ok, now we want to concat these two strings.
for this we will use + operator

full_name = first_name + last_name

print full_name

strings

So, we have used concatenation
Now let's put space in between for that we will use

full_name = first_name + ' ' + last_name

print full_name

So, we have used + operator to combine two strings.

In programming white spaces refers to any non programming characters such as spaces, tabs and end of line symbols.
ok, let's see som examples

str = "Vikram\tSalunke"

print str

strings

So, \t is inserting a tab here

Now let's see example of new line

str = " x86 Assembly\nPython for InfoSec"

print str

strings

ok, so Python for InfoSec is on a new line because we have used \n here.

If you want to join our in person class then please click here we are doing trainings in some upcoming InfoSec conferences.
And if you have any doubts, any questions then you can tweet me @vikramsalunke20
We are uploading daily new videos on YouTube click here to subscribe.
If you want to solve the exercises on this topic those are below. Solve the exercises and check your understandings. Thank you :)