Skip to playerSkip to main content
  • 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.
Transcript
00:00Welcome back and good morning guys and girls.
00:06Last few lectures in the last few lectures,
00:08we had a basic level of concepts
00:12and the tool we used was more than sufficient.
00:17Now we have a new tool to change the level of concepts.
00:21Let's go to a new tool
00:23which is called repl.it
00:25You can use it straight away.
00:27Click on start coding
00:29and here you choose your interpreter.
00:32Python coding programming
00:33and create repl
00:35and you will be good to go.
00:36Otherwise,
00:37you can create your account
00:39using sign up
00:41or sign up
00:43login
00:44and you will be good to go.
00:46This is a data science.university account
00:48Let's get started.
00:50First of all, we have a new repl.
00:52Let's create a new repl.
00:54It's totally easy peasy.
00:56You can choose random name
00:58and we will let it be like this.
01:00Okay guys.
01:01Now,
01:03let's talk about advanced concept.
01:06Advanced concept
01:07Not very advanced
01:09but let's start from the baby steps.
01:13The first thing we have discussed is
01:16string concatenation.
01:18Okay.
01:19Now, I will say
01:20string concatenation.
01:21Okay.
01:22Now,
01:23I will say
01:24string concatenation.
01:26Oh,
01:27catenation.
01:28Okay.
01:29Okay.
01:30Okay.
01:31Now,
01:32we have a concept
01:33and then,
01:34I will show you
01:35this example.
01:36String concatenation
01:37means that
01:38two strings
01:39together.
01:40Okay.
01:41And this is like
01:42glue with two pieces
01:43together.
01:45Okay.
01:46Then,
01:47weld and metal
01:48together.
01:49Now,
01:51Python
01:52concatenation
01:53string
01:54perform
01:55for
01:56addition
01:57which is
01:59which is
02:00plus
02:01sign.
02:02For example,
02:03let's say
02:04Hola.
02:05Hello.
02:06Plus
02:07and
02:09Watson.
02:10Now,
02:11this case
02:12which is
02:13basically
02:14string
02:15concatenation
02:16used
02:17and
02:18arithmetic
02:19operator
02:20use
02:21which is
02:23important
02:24point
02:25you have to
02:26ask.
02:27What is
02:28operator overloading?
02:29Operator overloading
02:30classical
02:31example
02:32string
02:33concatenation.
02:34Operator overloading
02:35means that
02:36one operator
02:37is more
02:38working.
02:39Now,
02:40plus
02:41normal
02:42is
02:43two
02:44things
02:45add.
02:46However,
02:47now,
02:48this
02:49is
02:50operator
02:51overloading.
02:52If you have
02:53asked me,
02:54you can tell me.
02:55Now,
02:56I will print it.
02:57Now,
02:58I will print it.
02:59Now,
03:00I will print it.
03:01So,
03:02we will get
03:03hello
03:05motion.
03:06We will run it.
03:08And
03:09we will get
03:10hello motion.
03:11This is so cool.
03:12We will run it.
03:13Now,
03:14we will run it.
03:15We will run it.
03:16Now,
03:17we will run it.
03:18the same.
03:19However,
03:20interesting enough,
03:21that
03:22I will run it.
03:23Now,
03:24I will remove it.
03:25Now,
03:26I will remove it.
03:27Now,
03:28I will write it.
03:29Now,
03:30I will write it.
03:31Now,
03:32I will write it.
03:33Name is equal to motion.
03:34Now,
03:35I will write it.
03:36However,
03:37I will write it.
03:38Now,
03:39I will run it.
03:40The result will be exactly the same.
03:41However,
03:42interesting enough,
03:43I will write it.
03:44Now,
03:45I will write it.
03:46Now,
03:47I will write it.
03:48Now,
03:49I will write it.
03:50Now,
03:51I will write it.
03:52Hello,
03:53John.
03:54Now,
03:55I will write it.
03:56Hello,
03:57Sally.
03:58This is totally fine.
03:59Cool.
04:00Now,
04:01I will write it.
04:02Now,
04:03I will write it.
04:04Now,
04:05let's say,
04:06you have a e-commerce store.
04:08And,
04:09you have a customer's greeting messages.
04:11And,
04:12let's say,
04:1310,000 customer.
04:15Now,
04:1610,000 customer's name
04:17you can't change.
04:19The best way will be?
04:21Now,
04:22why will be customer's name
04:23enter product
04:24during the time
04:25and send us the name
04:27to the user from input.
04:29Interesting.
04:30So,
04:31you will have input function
04:33to use input.
04:34It is just like that.
04:35However,
04:36this allows you to say
04:37that input function
04:38has 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:09prompt рд╣реЛрдЧрд╛, 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:39same 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:09return рдХрд░ рд░рд╣рд╛ рд╣реИ, as a string 5, рдЕрдм рдЬрд░рд╛ рдЖрдкрдиреЗ рдШреМрд░ рдХрд░рдирд╛ рд╣реИ, рдЕрдЧрд░ рдореИрдВ рдпрд╣рд╛рдВ рдкрд░ simple directly 5 рд▓рдЧ рджреЗрддрд╛ рд╣реВрдБ, рдЕрдм рдпрд╣рд╛рдВ рдкрд░ рддреЛ number рдпрд╣ рд╣реИ, рдпрд╣ рддреЛ number рд╣реИ, рдпрд╣ рддреЛ convert рд╣реЛрдХреЗ рдирд╣реАрдВ рдЖ рд░рд╣рд╛ рд╣реИ, рдЕрдЪреНрдЫрд╛, рдореИрдВ рдЗрд╕ рддрд░рд╣ рдХрд░рддрд╛ рд╣реВрдБ, рдХрд┐ рдЗрди рджреЛ рдХреЛ, рдЗрди рддреАрдиреЛрдВ рдХреЛ, рдареАрдХ рд╣реИ, рдЗрди рджреЛрдиреЛрдВ рдХреЛ, рдореИрдВ comment out рдХрд░ рджреЗрддрд╛ рд╣реВрдБ,
08:39only can concatenate string not integer to string, рдпрд╛рдирд┐ рдХрд┐ рд╡реЛ рдХрд╣ рд░рд╣рд╛ рд╣реИ, рдХрд┐ рдореИрдВ string рдХреЛ string рдХреЗ рд╕рд╛рде рдЬреЛрдб рд╕рдХрддрд╛ рд╣реВрдБ, рдпрд╛рдирд┐ рдХрд┐ рдореИрдВ metal рдХреЛ metal рдХреЗ рд╕рд╛рде рдЬреЛрдб рд╕рдХрддрд╛ рд╣реВрдБ, рдореИрдВ рд▓рдХрдбреА рдФрд░ metal рдХреЛ рдирд╣реАрдВ рдЬреЛрдб рд╕рдХрддрд╛ рдЖрдкрд╕ рдореЗрдВ, рддреЛ рдЖрдкрдиреЗ рдЗрд╕ рдЪреАрдЬ рдХрд╛ рдзреНрдпрд╛рди рд░рдЦрдирд╛ рд╣реИ, however, рдЬрдм рдпрд╣ рдЖрдк рдЧреБрдЬрд╛рд░рддреЗ рд╣реИрдВ input function рд╕реЗ, рддреЛ рдпрд╣ integer рдЬреЛ рд╣реИ, рд╡реЛ automatically рдПрдХ string рдореЗ
09:09from the
Be the first to comment
Add your comment

Recommended