Introduction to: Python coding challenges

Python
Transcript

English (Auto-generated)

Thank you. Hello everyone and welcome to my coding to add my series. Um And this is going to be the introduction to this video series. So basically what my series is going to consist of is of doing multiple coding challenges with you guys and most of them are going to be pretty basic. But um as we continue going on with this series, hopefully they'll be they will slowly be getting more and more advanced until we until we reach our limit I guess. So what we're going to be doing today is just kind of going through a very basic coding challenge where I'm kind of gonna be showing you guys how each podcast is going to work and help what it's gonna consist of each time by just doing a very basic one right now. This coding time, it's probably one that you're gonna um pass by various times in your coding life. So um it's basically where we get string and we reverse it. So what we're gonna do here is in order to reverse a string, we know that we have to go through each character in the string. So we're gonna do four a 4 loop four, we could say four x. And string. Right? But since in python we like to use very readable and understandable Variable names and um readable code in general when they use four char in string we're going to that makes a new string um which I'm actually gonna sign over here up top over here to create the variable new string equals and we're just gonna pass it and empty and empty strength. Now it's gonna equal it's gonna equal charts since we wanted to be at the beginning of the string each time plus new string. Since we want the new string to be episode after the chart. And that should work. So now we're going to return new strength. Okay, that should work. And just so we can see it down here on our terminal. We are going to put print and then we're gonna put reverse string and then we're going to make it um let's say the classic hello the world. There we go. So this should work and now we're going to attempted in the terminal. Down below over here open terminal and use Python three that when you use intro dot and then as you see there it reverse, it returns Hello World while it prints Hello world reversed. And just to make sure our code works very well. Um Let's try a random string. Let's just say hello and welcome. Go to mission point and here we can try it, python intro. Actually there you go. And as you can see it works perfectly. So after we solve the coding challenges in each code, cause we're going to attempt to re factor it as much as we can if you're not familiar with the term. Re factoring it's basically just making it as clean and as readable as possible. So here we're doing a lot of extra things and later we're going to use slice notation to make it as simple as possible. Um If you don't understand science education, that's for that's perfectly fine because we're gonna get into it more in later code cast later on in the series. But for now we're just gonna make it, we're just gonna use it right now really quick just to show how much cleaner our code could be. So we're gonna get we're gonna put return string and we're gonna use slice notation and then read it That that's a -1. And now over here try it actually. We're not calling it yet. We're not calling the string. So we're going to print print reverse extreme. And once again we're gonna make it Hello World just to make sure it works and so make sure you come here and first string. Oh sorry my breath. I put this belt on. Okay. No, as you can see it works perfectly. So basically that's what each um code test in this series is going to consist of, I'm going to go through a simple coding challenge with you guys or maybe not so simple it every time. But um we're gonna do our best and then we factor it as much as we can after we make our initial code and there are two things that I find fun in this coding challenge which is basically one that every friday which I'm going to call free code friday I'm going to just get around coding challenge that I find. And since in most of these code cast, I'm gonna have prior preparation and knowledge of how to solve these podcasts on free code friday. I'm just gonna go into this podcast and just solve it with you guys, show you guys my way of thinking in my way of problem solving and um so you guys can get a more raw version of how to solve these problems, and also you guys can tell me any coding challenge that you would like me to do, and I'll gladly solve them and show you guys step by step how to do it and then show you guys a much cleaner version of it later. So I hope you guys really enjoy these code casts. I'm gonna um This code ca at this podcast series is mainly just gonna be for python. And but in my upload other series where I go into deeper topics of other things and with this um podcast series, you really do not need any basic knowledge of python, Maybe very, very basic things, but I'll get more into that later on, um and everything I'm gonna try to get very in depth um into explaining how it works. So even if you don't have any prior experience to python, I'll explain it the best way I can in order for everyone to be able to understand how to solve those problems in um in a and it was a very good understanding. So thank you so much, so much for tuning into this code cast and this introduction video. Um, and I hope you tune in tomorrow to podcast and thanks so much for watching.
505 Views 0 Likes 0 Comments

Introduction to my python series while solving a basic coding challenge :)

Comment
Leave a comment (supports markdown format)