Skip to player
Skip to main content
Search
Connect
Watch fullscreen
4
Bookmark
Share
More
Add to Playlist
Report
Lecture 28: String Concatenation in Python Programming
Nafees AI Lab
Follow
8 months ago
String concatenation refers to the process of combining two or more strings into a single string. It can be done by either appending one string to another or creating a new string that contains the original strings in sequence.
Category
ЁЯУЪ
Learning
Transcript
Display full video transcript
00:00
Welcome back and good morning guys and girls.
00:06
Last few lectures in the last few lectures,
00:08
we had a basic level of concepts
00:12
and the tool we used was more than sufficient.
00:17
Now we have a new tool to change the level of concepts.
00:21
Let's go to a new tool
00:23
which is called repl.it
00:25
You can use it straight away.
00:27
Click on start coding
00:29
and here you choose your interpreter.
00:32
Python coding programming
00:33
and create repl
00:35
and you will be good to go.
00:36
Otherwise,
00:37
you can create your account
00:39
using sign up
00:41
or sign up
00:43
login
00:44
and you will be good to go.
00:46
This is a data science.university account
00:48
Let's get started.
00:50
First of all, we have a new repl.
00:52
Let's create a new repl.
00:54
It's totally easy peasy.
00:56
You can choose random name
00:58
and we will let it be like this.
01:00
Okay guys.
01:01
Now,
01:03
let's talk about advanced concept.
01:06
Advanced concept
01:07
Not very advanced
01:09
but let's start from the baby steps.
01:13
The first thing we have discussed is
01:16
string concatenation.
01:18
Okay.
01:19
Now, I will say
01:20
string concatenation.
01:21
Okay.
01:22
Now,
01:23
I will say
01:24
string concatenation.
01:26
Oh,
01:27
catenation.
01:28
Okay.
01:29
Okay.
01:30
Okay.
01:31
Now,
01:32
we have a concept
01:33
and then,
01:34
I will show you
01:35
this example.
01:36
String concatenation
01:37
means that
01:38
two strings
01:39
together.
01:40
Okay.
01:41
And this is like
01:42
glue with two pieces
01:43
together.
01:45
Okay.
01:46
Then,
01:47
weld and metal
01:48
together.
01:49
Now,
01:51
Python
01:52
concatenation
01:53
string
01:54
perform
01:55
for
01:56
addition
01:57
which is
01:59
which is
02:00
plus
02:01
sign.
02:02
For example,
02:03
let's say
02:04
Hola.
02:05
Hello.
02:06
Plus
02:07
and
02:09
Watson.
02:10
Now,
02:11
this case
02:12
which is
02:13
basically
02:14
string
02:15
concatenation
02:16
used
02:17
and
02:18
arithmetic
02:19
operator
02:20
use
02:21
which is
02:23
important
02:24
point
02:25
you have to
02:26
ask.
02:27
What is
02:28
operator overloading?
02:29
Operator overloading
02:30
classical
02:31
example
02:32
string
02:33
concatenation.
02:34
Operator overloading
02:35
means that
02:36
one operator
02:37
is more
02:38
working.
02:39
Now,
02:40
plus
02:41
normal
02:42
is
02:43
two
02:44
things
02:45
add.
02:46
However,
02:47
now,
02:48
this
02:49
is
02:50
operator
02:51
overloading.
02:52
If you have
02:53
asked me,
02:54
you can tell me.
02:55
Now,
02:56
I will print it.
02:57
Now,
02:58
I will print it.
02:59
Now,
03:00
I will print it.
03:01
So,
03:02
we will get
03:03
hello
03:05
motion.
03:06
We will run it.
03:08
And
03:09
we will get
03:10
hello motion.
03:11
This is so cool.
03:12
We will run it.
03:13
Now,
03:14
we will run it.
03:15
We will run it.
03:16
Now,
03:17
we will run it.
03:18
the same.
03:19
However,
03:20
interesting enough,
03:21
that
03:22
I will run it.
03:23
Now,
03:24
I will remove it.
03:25
Now,
03:26
I will remove it.
03:27
Now,
03:28
I will write it.
03:29
Now,
03:30
I will write it.
03:31
Now,
03:32
I will write it.
03:33
Name is equal to motion.
03:34
Now,
03:35
I will write it.
03:36
However,
03:37
I will write it.
03:38
Now,
03:39
I will run it.
03:40
The result will be exactly the same.
03:41
However,
03:42
interesting enough,
03:43
I will write it.
03:44
Now,
03:45
I will write it.
03:46
Now,
03:47
I will write it.
03:48
Now,
03:49
I will write it.
03:50
Now,
03:51
I will write it.
03:52
Hello,
03:53
John.
03:54
Now,
03:55
I will write it.
03:56
Hello,
03:57
Sally.
03:58
This is totally fine.
03:59
Cool.
04:00
Now,
04:01
I will write it.
04:02
Now,
04:03
I will write it.
04:04
Now,
04:05
let's say,
04:06
you have a e-commerce store.
04:08
And,
04:09
you have a customer's greeting messages.
04:11
And,
04:12
let's say,
04:13
10,000 customer.
04:15
Now,
04:16
10,000 customer's name
04:17
you can't change.
04:19
The best way will be?
04:21
Now,
04:22
why will be customer's name
04:23
enter product
04:24
during the time
04:25
and send us the name
04:27
to the user from input.
04:29
Interesting.
04:30
So,
04:31
you will have input function
04:33
to use input.
04:34
It is just like that.
04:35
However,
04:36
this allows you to say
04:37
that input function
04:38
has prompted
04:39
рдХреЛ рдХрд┐ рдмрддрд╛рдирд╛ рднреА рд╣реИ рдПрдХ guidance text рднреА рджреЗрдирд╛ рд╣реИ рд╕рд╛рде рдореЗрдВ рд╡рд┐рд╕рд╛рд▓ рдХреЗ рддреЛрд░ рдкреЗ рдЖрдк рдХрд┐рд╕реА conference рдореЗрдВ рдЬрд╛рддреЗ рд╣реИрдВ рдЖрдк рдХрд┐рд╕реА рдирдИ building рдореЗрдВ рдЬрд╛рддреЗ рд╣реИрдВ рддреЛ рд╡рд╣рд╛рдБ рдкреЗ signs рд▓рдЧреЗ рд╣реЛрддреЗ рд╣реИрдВ рди рд╡реА toilet to the left, conference room to the right, рдРрд╕реЗ рд╣реА рд╣реИ рди рд╡реЛ guidance post рд╣реЛрддреА рд╣реИ рддреЛ рдпрд╣рд╛рдБ рдкрд░ рднреА рдРрд╕реЗ рдЖрдк guidance post рджреЗрддреЗ рд╣реИрдВ рдХрд╣рддреЗ рд╣реИрдВ please enter your name, рд╕рд╣реА рд╣реИ рдпрд╣ рджреЗрдЦрд┐рдП, enter your name
05:09
prompt рд╣реЛрдЧрд╛, enter your name, рдФрд░ рдЬреЛ value рдЖрдк assign рдХрд░реЗрдВрдЧреЗ, рд╡реЛ input function рдХреЛ use рдХрд░рддреЗ рд╣реБрдП name рдХреЛ assign рд╣реЛ рдЬрд╛рдПрдЧреА, make sense, рдЕрдм рдЬрд░ рдЖрдкрдиреЗ рдЧрд╡рд░ рдХрд░рдирд╛ рд╣реИ, рдЕрдЧрд░ рдореИрдВ рдЗрд╕рдХреЛ run рдХрд░рддрд╛ рд╣реВрдБ, рддреЛ code рдЖрдЧреЗ рдирд╣реАрдВ рдЬрд╛рдПрдЧрд╛, рдЬрдм рддрдХ рдореИрдВ рдЙрд╕рдХреЛ рдХреЛрдИ value рдирд╣реАрдВ рджреЗ рджреЗрддрд╛, рдЕрдм рджреЗрдЦрд┐рдП, рдпрд╣рд╛рдБ рдкрд░ рдХрд╣рддрд╛ рд╣реВрдБ john, рдареАрдХ рд╣реИ, run рдХрд┐рдпрд╛, hello john,
05:39
рдореБрдЭреЗ рдкрддрд╛ рд╣реИ, рдЖрдкрдХреЛ рдкрддрд╛ рд╣реИ, рдХреНрдпреЛрдВрдХрд┐ рдЖрдкрдиреЗ code рджреЗрдЦрд╛ рд╣реБрдЖ рд╣реИ, рдХрд┐ рдпрд╣рд╛рдБ рдкреЗ рддреЛ рдореИрдВрдиреЗ input рдХрд░рдирд╛ рд╣реИ name, however, рдПрдХ user рдХреЛ idea рдирд╣реАрдВ рд╣реИ, рдХрд┐ рдпрд╣рд╛рд░ рдЙрд╕рдиреЗ рдХреНрдпрд╛ рдХрд░рдирд╛ рд╣реИ рдпрд╣рд╛рдБ рдкреЗ, рдПрдХ рдирдпрд╛ рдмрдВрджрд╛, рдЬреЛ рдХрд┐ рдЖрдпрд╛ рдЖрдкрдХреА, let's say website рдХреЗ рдЙрдкрд░ рдФрд░ рдФрд░ рдЗрд╕ рддрд░рд╣ рдХреА screen рджреЗрдЦреА, what should he do, he have no clue, рдЗрд╕рд▓рд┐рдП, it's a very good idea, рдХ
06:09
рдЕрдм рдЖрдкрдиреЗ рдЧрд╡рд░ рдХрд░рдирд╛ рд╣реИ, рдХрд┐ рдЕрдЧрд░ input рдкреЗ, рдЬреИрд╕реЗ рдХрд┐ рдореИрдВрдиреЗ рдЖрдкрдХреЛ example рджреА, рдХрд┐ concatenation рдРрд╕рд╛ рд╣реИ, рдЬреИрд╕реЗ рджреЛ metals рдХреЛ рдЖрдкрд╕ рдореЗрдВ weld рдХрд░рдирд╛, рдЖрдк рдПрдХ рд▓рдХрдбреА рдХреЗ рдлрдЯреЗ рдХреЛ рдФрд░ steel рдХреЗ rod рдХреЛ weld рдирд╣реАрдВ рдХрд░ рд╕рдХрддреЗ, рдХреНрдпреЛрдВрдХрд┐ рд╡реЛ different materials рд╣реИрдВ, make sense рдХрднреА рдЖрдкрдиреЗ notice рдХрд┐рдпрд╛ рдпрд╣, рдХрд┐ рдЖрдк рдПрдХ рд▓рдХрдбреА рдХреЛ рдФрд░ рдПрдХ рд▓реЛрд╣реЗ рдХреЛ рдЖрдкрд╕ рдореЗрдВ weld рдирд╣реАрдВ рдХрд░
06:39
same way, рдЖрдк рдПрдХ number рдХреЛ рдФрд░ рдПрдХ string рдХреЛ concatenate рдирд╣реАрдВ рдХрд░ рд╕рдХрддреЗ, рдорд┐рд╕рд╛рд▓ рдХреЗ рддреЛрд░ рдкреЗ рдЖрдкрдиреЗ рднреА рдпрд╣ рдЬрд░рд╛ рдЧрд╡рд░ рдХрд░рдирд╛ рд╣реИ, рдореИрдВ run рдХрд░рддрд╛ рд╣реВрдБ, рдФрд░ рдореИрдВ рдХрд╣рддрд╛ рд╣реВрдБ, рдореЗрд░рд╛ рдирд╛рдо рдЬреЛ рд╣реИ, рдЗрд╕ рджрдлрд╝рд╛ 5 рд╣реИ, рдареАрдХ рд╣реИ, 5 рдХреНрдпрд╛ рд╣реИ, рдПрдХ number рд╣реИ, рдореИрдВ рдЗрд╕рдХреЛ run рдХрд░рддрд╛ рд╣реВрдБ, and you see, рд╡реЛ рдХрд╣ рд░рд╣рд╛ рд╣реИ, hello 5, рдЕрдм рдЬрд░рд╛ рдЖрдкрдиреЗ рдЧрд╡рд░ рдХрд░рдирд╛ рд╣
07:09
рдФрд░ рдХрд╣реЗрдВ, рдЯрд╛рдЗрдк, рдЯреА рд╡рд╛рдИ рдкреА рдЯрд╛рдЗрдк, рдЯреА рд╡рд╛рдИ рдкреА рдЯрд╛рдЗрдк, рдареАрдХ рд╣реИ, рдФрд░ рдиреЗрдо рдХреА рдЬреЛ рдЯрд╛рдЗрдк рд╣реИ, рд╡реЛ рдмрддрд╛рдУ, рдареАрдХ рд╣реИ, рдЕрдЪреНрдЫрд╛, рдЕрдм рдЬрд░рд╛ рдЗрдВрдЯрд░ рдХрд░рддреЗ рд╣реИрдВ, рджреЛрдмрд╛рд░рд╛, рдореИрдВ рдХрд╣рддрд╛ рд╣реВрдБ, 5 рдЗрдВрдЯрд░ рдХрд┐рдпрд╛, рдпреЗ рдХреНрдпрд╛ рдмрд╛рдд рд╣реБрдИ, рдореИрдВрдиреЗ рддреЛ 5 as a number рдЗрдВрдЯрд░ рдХрд┐рдпрд╛ рдерд╛, рдФрд░ рдЬрдм рдореИрдВ рдЗрд╕
07:39
рд╣реИ, рдХрд┐ рдпрд╣рд╛рдВ рдкрд░ type conversion рд╣реЛ рд░рд╣реА рд╣реИ, рдпрд╣ рдЬреЛ input function рд╣реИ, рдпрд╣ рдореБрдЭ рд╕реЗ рдкреВрдЫреЗ рдмрдЧрд╛рдПрд░ 5 integer рдХреЛ рд▓реЗрддрд╛ рд╣реИ, рдФрд░ рдЙрд╕рдХреЛ string рдореЗрдВ convert рдХрд░ рджреЗрддрд╛ рд╣реИ, рддреЛ this is very important point, рдХрд┐ рдЬрдм рдЖрдк input рд▓реЗрдВрдЧреЗ user рд╕реЗ, рдпрд╛ рдХреЛрдИ game рдЦреЗрд▓ рд░рд╣реЗ рд╣реИрдВ, рдпрд╛ рдХреЛрдИ рдФрд░ application рдмрдирд╛ рд░рд╣реЗ рд╣реИрдВ, рддреЛ user рд╕реЗ рдЬрдм рдЖрдк input рд▓реЗрдВрдЧреЗ, рддреЛ рдЖрдкрдиреЗ make sure рдХрд░рдирд╛ рд╣реИ, рдХрд┐ рд╡реЛ basically рд╕рд╣реА data type
08:09
return рдХрд░ рд░рд╣рд╛ рд╣реИ, as a string 5, рдЕрдм рдЬрд░рд╛ рдЖрдкрдиреЗ рдШреМрд░ рдХрд░рдирд╛ рд╣реИ, рдЕрдЧрд░ рдореИрдВ рдпрд╣рд╛рдВ рдкрд░ simple directly 5 рд▓рдЧ рджреЗрддрд╛ рд╣реВрдБ, рдЕрдм рдпрд╣рд╛рдВ рдкрд░ рддреЛ number рдпрд╣ рд╣реИ, рдпрд╣ рддреЛ number рд╣реИ, рдпрд╣ рддреЛ convert рд╣реЛрдХреЗ рдирд╣реАрдВ рдЖ рд░рд╣рд╛ рд╣реИ, рдЕрдЪреНрдЫрд╛, рдореИрдВ рдЗрд╕ рддрд░рд╣ рдХрд░рддрд╛ рд╣реВрдБ, рдХрд┐ рдЗрди рджреЛ рдХреЛ, рдЗрди рддреАрдиреЛрдВ рдХреЛ, рдареАрдХ рд╣реИ, рдЗрди рджреЛрдиреЛрдВ рдХреЛ, рдореИрдВ comment out рдХрд░ рджреЗрддрд╛ рд╣реВрдБ,
08:39
only can concatenate string not integer to string, рдпрд╛рдирд┐ рдХрд┐ рд╡реЛ рдХрд╣ рд░рд╣рд╛ рд╣реИ, рдХрд┐ рдореИрдВ string рдХреЛ string рдХреЗ рд╕рд╛рде рдЬреЛрдб рд╕рдХрддрд╛ рд╣реВрдБ, рдпрд╛рдирд┐ рдХрд┐ рдореИрдВ metal рдХреЛ metal рдХреЗ рд╕рд╛рде рдЬреЛрдб рд╕рдХрддрд╛ рд╣реВрдБ, рдореИрдВ рд▓рдХрдбреА рдФрд░ metal рдХреЛ рдирд╣реАрдВ рдЬреЛрдб рд╕рдХрддрд╛ рдЖрдкрд╕ рдореЗрдВ, рддреЛ рдЖрдкрдиреЗ рдЗрд╕ рдЪреАрдЬ рдХрд╛ рдзреНрдпрд╛рди рд░рдЦрдирд╛ рд╣реИ, however, рдЬрдм рдпрд╣ рдЖрдк рдЧреБрдЬрд╛рд░рддреЗ рд╣реИрдВ input function рд╕реЗ, рддреЛ рдпрд╣ integer рдЬреЛ рд╣реИ, рд╡реЛ automatically рдПрдХ string рдореЗ
09:09
from the
Be the first to comment
Add your comment
Recommended
0:43
|
Up next
What is String ?
Coding Version
3 years ago
7:18
Lecture 30: String Formatting in Python
Nafees AI Lab
8 months ago
38:23
Jin Ki Shaadi Unki Shadi Episode 27 | English CC | Pakistani Drama | Full HD
Febspot Studio
6 weeks ago
0:27
5 Amazing Science Experiments | Quick & Easy DIY Tricks
Febspot Studio
9 months ago
9:38
Episode 1 тАУ The Curious Boy from Ulm (1879-1895)
Nafees AI Lab
7 months ago
0:37
Top Fully Funded Scholarships in Germany 2025 ЁЯЗйЁЯЗк | Apply Now!
Nafees AI Lab
7 months ago
0:25
The Boy and the Dragon тАУ тАЬA Friend in the SkyтАЭ
Nafees AI Lab
7 months ago
1:03
Why Do Rainbows Appear? ЁЯМИ | Physics in Everyday Life
Nafees AI Lab
7 months ago
0:28
Albert Einstein: The Genius Who Changed Time
Nafees AI Lab
7 months ago
0:40
Stephen HawkingтАЩs Life in 60 Seconds: From Wheelchair to the Universe
Nafees AI Lab
7 months ago
0:36
The Forgotten Night Hitler Was Nearly Killed
Nafees AI Lab
7 months ago
0:31
Dilip Kumar тАУ The Tragedy King of Bollywood
Nafees AI Lab
7 months ago
0:45
Marlon Brando тАУ The Rebel Who Redefined Acting | Nafees AI Lab
Nafees AI Lab
7 months ago
0:29
Charles Darwin тАУ Evolution & Natural Selection | Nafees AI Lab
Nafees AI Lab
7 months ago
0:30
Isaac Newton тАУ Gravity, Motion & Genius | Nafees AI Lab
Nafees AI Lab
7 months ago
0:52
Allama Iqbal тАУ Poet of the East | Nafees AI Lab
Nafees AI Lab
7 months ago
0:53
Marie Curie тАУ Life & Achievements | Nafees AI Lab
Nafees AI Lab
7 months ago
0:42
Albert Einstein тАУ Life, Legacy & Discoveries | Nafees AI Lab
Nafees AI Lab
7 months ago
10:08
Pandas Class 10: Manipulating Data тАУ Sorting, Renaming & More
Nafees AI Lab
7 months ago
12:30
Pandas Class 09: Adding & Removing Data in Pandas
Nafees AI Lab
7 months ago
11:25
Pandas Class 08: Changing Data in Pandas тАУ Replace & Update
Nafees AI Lab
7 months ago
14:15
Pandas Class 07: More on Data Selection in Pandas
Nafees AI Lab
7 months ago
13:58
Pandas Class 06: Data Selection in Pandas тАУ iloc & loc
Nafees AI Lab
7 months ago
6:59
Pandas Class 05: Describing & Summarizing Data in Pandas
Nafees AI Lab
7 months ago
7:00
Pandas Class 04 тАУ How to Import CSV, Excel & JSON Files
Nafees AI Lab
7 months ago
Be the first to comment