Professional Python Web Development Using Flask | Jorge Escobar | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Professional Python Web Development Using Flask

teacher avatar Jorge Escobar, Technologist, entrepreneur and open source fanatic

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.



    • 2.

      What is Backend Development?


    • 3.

      Why Python?


    • 4.

      The FromZero Approach


    • 5.

      Introduction to Cloud9


    • 6.

      Closer Look IDE


    • 7.

      Shell Commands


    • 8.

      Python Shell


    • 9.

      Arithmetic Functions


    • 10.



    • 11.

      Checking Types


    • 12.

      Variable Format


    • 13.



    • 14.

      Lists, Tuples and Dictionaries


    • 15.

      Date and time


    • 16.

      Conditionals Control Flow


    • 17.



    • 18.



    • 19.

      Classes and Objects


    • 20.



    • 21.



    • 22.

      New Workspace Virtualenv


    • 23.

      Pip Install Flask


    • 24.

      C9 Python Path


    • 25.

      Minimal App


    • 26.

      Starting with Git


    • 27.



    • 28.

      Routing with Vars


    • 29.



    • 30.

      Get Method


    • 31.

      Post Method


    • 32.

      Introduction to Templates


    • 33.

      Login Template


    • 34.

      Login Function


    • 35.

      Redirect After Post


    • 36.

      Flash Messages


    • 37.

      Better HTML


    • 38.

      Block Super


    • 39.

      Template Inheritance


    • 40.



    • 41.

      Static Folder


    • 42.



    • 43.



    • 44.

      User Table


    • 45.

      Intro Mysql


    • 46.



    • 47.

      Let's begin with our Blog


    • 48.

      The Basic Structure


    • 49.

      The Author Model


    • 50.

      Setting Up the ORM


    • 51.

      Interacting with the ORM


    • 52.

      The Base Template and Bootstrap


    • 53.

      Introduction to WTForms


    • 54.

      Form Errors


    • 55.



    • 56.

      Blog Model and Form


    • 57.

      Blog Admin and Setup Templates


    • 58.

      Blog Creation Database


    • 59.

      Author Login


    • 60.

      Login Required Decorator


    • 61.

      Introduction to Migrations


    • 62.

      More Secure Password


    • 63.

      Checking is_author


    • 64.

      The Post and Category Model


    • 65.

      Post Migration and Testing


    • 66.

      Introduction to Markdown


    • 67.

      Post Form


    • 68.

      Saving the Post to Database


    • 69.

      The Article View


    • 70.

      List Articles


    • 71.

      Logout Links Footer


    • 72.



    • 73.

      Installing Flask Uploads


    • 74.

      Adding Image Blog Post


    • 75.

      View Image Index Article


    • 76.

      Deleting Article


    • 77.

      Editing Articles


    • 78.

      Introduction to Unit Testing


    • 79.

      Create Blog Test


    • 80.

      User Tests


    • 81.

      Final Project


  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Learn from scratch how to build backend web applications using Python Flask, Cloud9, MySQL and Docker Containers

This course will teach you, assuming no prior coding knowledge, how to develop back end web applications the way professional coders do in the top internet startups. How do I know this? Because I've been leading tech teams in both large enterprise as well as startup companies in New York City for the past 15 years.

I have seen a lot of courses and free tutorials and I can tell you 90% of them just teach bad habits while promising to turn you into a real “web developer". But let me tell you a reality: There's no such thing as a web developer these days. You're either a back end web applications developer, a front end application developer or the so-called (and rare) full stack web developer which includes the other two. However there are so many technologies to master in both the backend and frontend areas that full-stacks (or “web developers") are a rarity in professional environments -- You're either a back end or a front end web developer.

This course doesn't promise to turn you into a professional back end developer after you complete it -- it takes much more than the 11 hours of of this course (and probably hundreds of hours of self-practicing) to do that, but it will give you a good foundation from where to start and continue your training, knowing the right path to become a real professional backend web applications developer using Python. My goal is to make a second course, which would introduce more advanced back end concepts and then start the front end courses (basic and advanced) soon after that.

The course goes through a step by step process of developing web applications, teaching you the Python basics for web development, introducing Flask and using Cloud9 as your development environment. It then moves to explore SQL databases, using MySQL and finally showing you how to develop a blogging application using all these learnings.

Best of all, you don't need to install anything as we will use a revolutionary online web development environment that essentially gives you your own Linux web server with database capabilities! All you need to have is a browser and internet connection and it's completely free to you.

The course is divided in 8 sections and 2 bonus sections:

  • Introduction
  • Setting up our environment
  • Python basics
  • Installing Flask
  • Introduction to Flask
  • An introduction to databases
  • Our first Flask application: A personal blog powered by MySQL
  • Final Project
  • Bonus: Running Our Flask Application with Docker
  • Bonus: Deploying our Application to a Cloud Server

The course has more than 12 hours of video tutorials as well as the source code at the end of each of the Flask application lessons, so that you can see exactly what the whole project looks like in each stage.

The course can take anywhere from 10 days to a month to complete based on how much material the student completes daily.

Additionally we're constantly updating the course, adding content thanks to the feedback of our students.

We will also have office hours where you can ask the instructor any question you might have about the course or about Python Backend Web Application Development in general.

So If you are interested in learning how to code from zero and without prior knowledge, but do it using best industry practices towards becoming a professional backend web developer, this is the course for you.

So stop looking around and start the right path to becoming a professional Python backend web developer with this course!

What are the requirements?

  • A computer with internet access and administrative access to install packages
  • A basic understanding of how to use the internet and text editors

What am I going to get from this course?

  • You will learn the basics of the Python programming language
  • You will learn what databases are and how to use them effectively
  • You will learn how to interact with the database using the MySQL CLI
  • You will learn how to effectively develop a Flask application
  • You will learn about Software Patterns like MVC and decorators
  • You will learn how to process data from HTML Forms into a web application
  • You will learn how to run Flask applications using Docker
  • You will learn how to deploy an application to a cloud server

What is the target audience?

  • Programmers
  • Software Developers
  • Project Managers
  • Computer students
  • Entrepreneurs
  • Software development aficionados

Meet Your Teacher

Teacher Profile Image

Jorge Escobar

Technologist, entrepreneur and open source fanatic


From Zero is an educational project created by Jorge Escobar, a technologist, entrepreneur and open source fanatic with more than 15 years of experience in the development of web applications in New York City.

Jorge has worked in well established companies like Yahoo!, Univision and MongoDB and has also been the technical founding member of various successful tech startups that have received multiple rounds of venture capital.

The biggest problem Jorge has experienced during his career is finding well rounded developers and he interviewed hundreds of them for positions in the teams he was leading. A constant pattern (no matter if candidates came from a good university or had a few years of experience) was the lack of practical, real world knowledge.

That's why Jorge... See full profile

Level: Beginner

Class Ratings

Expectations Met?
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Introduction: Hi. Welcome to professional back in Web development with Pichon Flask, where you learn how to build where applications Using the amazing Python language. My name is Jorge Escobar, and I've been lucky to work in the leading tech companies for the past 15 years, and now we'll show you from scratch how to become a professional Web developer. You can find a lot of online courses that promise you how to become a Web developer. The truth is that in the professional tech industry, there's no such thing as Web developer positions. You're either a back and developer or front end developer on the skills required for each are completely. This course will show you step by step, the best practices to begin your career to become unemployable back in Web applications. Developer I will show you step by step and through the power of video on introduction toe the Python language. How to install Flask, a first look at sequel databases and then we'll build a blogging application using best development practice. At the end of the course, you will challenge to expand the application by developing a commenting system for Blawg. You will also be able to get the full court base as it looks each step of the way so you can develop your knowledge looking at how the system grows bit by bit. The course is the sign for people with little or no previous coding knowledge but are eager to learn how to build Web applications. All you need is a computer and the willingness to put your full attention toe the Metis. Listen. There are other courses that go the easy route and teach using graphical tools. I can tell you, those students would not survive a real life interview in a professional by my course now, and I will start your path to becoming a professional python backend weapon. 2. What is Backend Development?: Okay, let's take a look at what is front and back in development. Um, for that we're going to check what a Internet process looks like on a very high level. Um, let's a diagram and and understand what the steps look like when you request a page. So the first thing you need to know is that there's always a browser and a client. The browser is basically the program that you used to access the Web, the Firefox grown Internet Explorer, whatever you use, and then the server is basically a service that's out there in the Internet. Basically, um, it's a group off servers or computers that are, um, located in a specific you're out. So when you type of euro, what happens is the, um, your Internet provider will hook you up, will direct you to the appropriate server, and then that server will has a process that's a looping process that is always checking. Is there any requests there any requests? And when it received your request for a specific page, it ah basically renders or or comes up with the with the code to build the page that you're requesting, and for that it can access a database where where all this content is is located. Once that Carlton is located, it packages all that up into a webpage on B, returns it back to the browser where the browser will render it as, ah, so appropriate. So what is back end development in front of it? Development? Um, so the idea is that back in development is the processes or the software, Um, the code and the, um the different routines and algorithms that live in the server, um, and interact with the with the database, um, versus the browser code, which is the front. And development so far in development entails working with HTML, CSS and Js, which are ah, the basic, you know, languages for the basic systems that allow the browser to render the content of the server is giving back. So you can think of it as front and being, um, everything that has to do with what declines sees and then back in is all the data behind. Ah, what that page looks like. So in this course, we're gonna we're gonna focus on that on that piece, we're gonna be talking about how to code um, and Ah, and how to develop applications that are inherently listening for requests from a browser and return back ah content code, if you will, that will allow the browser to render that data that information that is stored in the Indus Server. 3. Why Python?: Okay, So one question you may ask it's y Python, where we're learning Typhon or back in development and not something else. And there's a lot of other languages that are that are suitable and have good Ah, you know, good reviews or or their talked about very well on the Internet. And I think it's a personal decision. My personal experience has been that Python has been a very, um, easy to learn, like the learning curve is not too steep. Um, but it's also a language that that it's a joy to read, um, a lot off coding when you're when you have a coating. Careers is about reading other people's code, and Tyson makes it really easy to understand. What, what the thinking waas off another quarter? Um, just by reading it without even looking at the comments, um, or documentation. I think, um, you know, Python ease is Ah, it's fast. Um, again, there are people that say that other things are are faster, but I think once you get into the, um, the real mawf Web, um, Web serving and serving times and all that I think there are many other Viable is to consider um, aside from how fast the languages. But having said that Python is Reese is pretty fast. Um, I like that. It's, ah, object oriented from the beginning. I think that we're gonna talk about a little bit. Why that that's important. But, um, s a first introduction toe. What that concept is it has to do with laying out your code in a way that's reusable and that you can leverage other people's work without having you to reinvent the wheel. Um, that's kind of like what object oriented for me is, ah, what the benefit is. It also, um, you know, building on top of that python is very extensively has a lot off, um, third party libraries that can do what I mean, there's, like, thousands off things that you can do with it from, you know, like math, um, calculations from hooking up to the most popular that air bases from, um, you know, interacting with social platforms like Facebook, Twitter and ah, you know, Ah, a lot off very, very exciting projects that, um that are across that believe across fields off different, different things, like from gaming to, like, scientific to business. So it has a lot off libraries, and the community around Python is very, um, very strong. They're very passionate about by phone, and you will hear about a little bit of the rivalries, especially with the folks that that, like Ruby on rails, which is kind of like a ah, big, um, it's a counterpart or or competition for Python. Then you know, you have to know jazz community also popping up. But it's a it's a friendly competition. I think that, um, you know, each language has he has its own strengths and its deficiencies. But I just like Python. I felt very much at home. Um, I came from, ah coding in peril and then pee. It's B and, ah, now python. I kind of like I look back and it will be very hard for me to go back to another language 4. The FromZero Approach: Hi. I wanted to talk to you a little bit about why is from zero different or better than other courses? Well, first of all, I have experience with complex projects. I've been working with both big companies and start ups, and I've completed a lot off high traffic and fast response, very complex projects that have, um, dozens off developers committing and contributing. So I know the best way to, um, approach a project and make it efficient, scalable. So I'm gonna teach you all those things that I that I know. Um and, um, one thing that I I I'm always striving to doing these courses is to guide you through the basics. Ah, or start with the basics. And then we want to advance topics in the most efficient way. I e I'm not gonna go into small details or maybe go through all the, um, all the chapters of a for example, Baekeland book. But I'm gonna go through the most efficient way so that you can get yourselves up and running and ready for development. Um, I'm also gonna be teaching this us hands on course in all the courses. That means that you're always gonna learn by doing and not just getting a lot of information off the projects or the courses or the languages before actually doing stuff. So it's gonna be very hands on, and I'm not gonna sugarcoat it. Um, it'll be I'm gonna teach you the hard way. Which means I'm not gonna teach you, for example, how to use my sequel or a database using a coolie like PHP. My admin. That's another way that professional developers do it. So I'm not gonna go ahead and just teach you something That's E. C. Because it's just easy for you to use it. You're gonna actually learn the tools the way that professional developers do it in in the leading tech startups. So I hope that you join me and that you enjoy this course on bond. I'll be there to assist to in every step of the way. Um, that's why let all the other students, But I can promise you that you're gonna learn, even though it's gonna be hard sometime, Um, you're gonna learn the proper way, and you're gonna be a professional Web developer in no time 5. Introduction to Cloud9: So now we're going to talk about what is the development environment that we're going to use. And I did some searching and I decided to finally go for Cloud nine. So Cloud nine is basically, ah, Web development environment. Think about it. I say your your server in the cloud. You can add it coding, and you can start databases and it works based on a technology every like, which is Doctor Um so I think it's It's ah, it's a great way for us to learn coding without, um, having to install things, installing python. And if you've if you've seen some of the courses I have, I always go into, like how toe set up. You know, the different environments and the databases and and all that. But I found that students, because they were just like starting to learn it, was kind of like an additional hassle for them to learn how to set up, you know, Windows, Paice, owner or Mac by phone, and then the data basis and all that. So I've decided to start using Cloud nine as the development environment for all my courses , and it's gonna be good because we're gonna be able to basically install and be able to code and work on this platform without having to install anything on our computers. And it doesn't matter what operating system you have for if it's Windows or Mac, you basically will have a lean it's machine running on, um, on the cloud, and you can edit and work on your application wherever you are. Um, the good thing is that they're they're pricing model. They have a free tier here, as you can see. And, you know, you can basically sign up, just enter your user name and password, and he has some pretty cool features like, um, collaborative coding. So, for example, you can, you know, called with another friend of yours or another student on you can we can install data basis and set of frameworks without any problems. So I think it's gonna be a good a good thing for us to use. And we're gonna go over it, um, a little bit us. We start doing the scores 6. Closer Look IDE: Okay, so let's get a little bit acquainted with different areas off cloud nine. So first you head over to see nine dot io, and you can basically just click on tried now to register, um, your new account. Um, once you click there, you can sign up with. If you have a gate, have account or a big bucket account, you can sign up with that. All the ones you can choose a user name and email and a password, and select here so that you can get, like, a capture and then create your frequent account. Like I said, they have ah free account here. They also have, like, some paid paid account ears. But for the purposes of this course, you don't need to really get into a a paying course. I mean, account. So I'm gonna log in with get hub. And when you when you sign in or you register, you get basically this area, which is the dashboard, and you have what they call workspaces and workspaces. Think of them as basically different projects and they're actually basically certain, like separate servers that you're creating with applications in it. Um, so initially you get this test workspace, and then you can create a new one, which is what we're gonna do when we start our first flask application. But let's see what happens when you when you select that existing workspace. But before we get there, if you click here on the name off the workspace, you basically have the capacity off. Like doing some editing you can have. Ah, you'll see a read me. You'll have the files that are in there. Um, so you can take, like, a quick look on. Leigh, Read me. Um is here in this in this test project, and here's a very interesting one. You have members and in members you can basically invite. If you have invited people, you can see them in there, um, to invite people, you need to be inside of the off the actual project. But you also you'll also see how much CPU using how many, how much of the ram and how much of the storage you're using. And they have. For the free tier, you can have up to one CPU 512 megs of ram and one gigabyte hard drive, which is more than then generous I find, um, but now that we know more or less, what's that about? Like I said, you click on the name itself. You'll see those those those statistics. But in order for us to actually start doing stuff, you click on this green open button. So once we click open here, well, we're gonna be taken toe the what's called the I. D or the integrated development environment. And basically, this is kind of like a code editor also has, like, a terminal here for the server. And you have a basically a file navigator, as you can like, you recognize from from similar type of applications, like coordinators Or, you know, even like, you know, work or editors. But, ah, here you can basically navigate what's in the folder. Right now, we only have this file read me MD on the side. Here we have basically, you can edit. Um, you know anything and you have an undo function as well, if you want. Um, it shares like a lot of the things that normal coordinators have, so it's It's very, very well built, Has a lot off capacity. You're not giving away a lot off, um, off power because you were using this disintegrated Ah, development environment. And here the bottom. We have the terminal, and this is something that I always kind off force students to kind of get very acquainted with because it's basically the the way that you interact more with with with systems we don't want to get used to using, like, graphical things. We want to be very comfortable with the with the terminal. If you click on this little kind of like a window function here, we will get a, uh, a standalone editor. And you can minimize again by clicking on that, um on that is likened. And 11 important one that you want to remember is control escape, which basically shows and hides that that terminal back and forth. Um, you can also, like, add tops here, for example. You can add a new like and I think when you when you've opened it for the first time, you'll see this in needed JavaScript editor. I usually close it because it's not something that we're gonna be using, uh, for this course, so you can go ahead and close it, but you can have another terminal window. Let's say from Ah, with another folder open or things that you want to do a swell. But in any case, um, it's it's ah, it's a very nicely integrated environment and what we're gonna look at next is some basic terminal function so that you guys get better acquainted with with terminal commands and how to copy and navigate directories and things like that. 7. Shell Commands: So the star playing a little bit with the terminal? Um, I have modified the callers as we can see here, Um, I going to Ah, you go here to Preferences, and then you go to, uh, terminal here. And then I put the background colder by clicking here to black so you can basically put any any combination of colors. I also increase the phone size to 18 so you guys can can see a little a little bit better. Um, and I close that and then let me put that in full screen and start, um, doing some basic a man so you can get acquainted with how, basically our linen, um, file management and and commence work. So the first thing we're gonna look is we want to know where we're at at a given time. And for that we use a chemical PWD, which is present working directory. And here it's It says that we're at home boom to work space. You see, guys understand. Home is basically usually the folder where the the accounts the user accounts are placed in . So if you had another user cold, you know Jorge, it would be slash home slash Jorge, and that's called the Home Directory for that user. And this still the basically represents that. So if you're in any that say we moved to any other folder, um, we can quickly go back by doing CD, which is change directory and putting that till they're there. It'll take us back to the to the home directory. Um, so and in cloud nine, there's a There's a workspace folder, which basically is where the projects are stored. I don't have a problem with that. I usually when I work on Lenox, I have, um, actually worked with the O. P. T directory. But workspace works finest well, so again to let us know where we're at PWD. So we're in the home Bhutto, which is the user that that Chlo nine assigns you automatically when you when you select the the bone to environment and then work space, which is a directory where, where we're at. So let's see at how we can see what the contents of the directory are. And that's basically the command ls So ls will show us what What files are in that current directory. And so, as you can see, we have read me dot MD, which is that Read me file that we saw on the editor earlier. Um, now, let's say let's say we want to create a new directory within the home. A boom to work space. The command for that It's make directory M k the I r. And let's say we create a direct trickle test. Um, Now, if we do ls you'll see that we have read me. And then we have a directory called Test. So in order for us to change the directory, get inside of that directory we used CD and then test. One trick that you guys want to know about is that you can put the first, like letters off, basically commands and directories and all that. And then if you press the tab, you'll see that it auto completes to whatever, um, the best matches on if you continue clicking tab, you continue seeing through those things. So if I If I do see the r and then click tab, you'll see that, um, it should get me toe. Since I'm not in the Marine, the workspace. So what? Basically, you will get the read me empty, but I'm going to go to the so if I do ls you'll see that? Read me there, um, on gonna change to the test directory here. So right now there's nothing in there. Um, the next thing we're gonna do is we're gonna use a common cold touch and touch is useful to create empty directories. Like, if you want to just create a quick, um, file that has nothing in it. So we can do, Let's say, test test, not txt. Um, if you do a less now, you'll see that, um, there's a test txt now in there. So that's a useful command we're gonna use it to. There's a, um there's a file name called Any P Y that we use for initializing directories as modules for python ball will get will get toe that quickly. If you want to clear the screen on, go back to the top. We used a clear command, and that puts us with a clear with a clear screen. Um, some other useful things. Let's say we have Ah, the test directory. Here. Let's create another directory called test. Um, in Let's say test in. Okay, so now we have tastic City and then another folder. We think that, um, cold test in. So let's say I want to move that folder. I mean, that filed spoon that's dot txt two. Their test in I use the M V command, which is move, and basically I'm gonna move test the txt to, ah, test in directory. So I do that. So I move. I'm saying move test txt to within the directory test in effect press enter there. Now, if I do a last, you'll see that we don't have test txt anymore, and it's in test in. But how do I checked up without having to go again? Like doing seedy testing You can actually do l s and then type the name off a directory. And if you press enter, you'll see the contents off that directory within, um, that that that folder that you have selected so you don't have to go inside of it. So that's the move, Command. Um, there's also, um, a very useful command called Cat. Let's go back to the to the home folder and then workspace. So see how I did that? Um, um, I'm now in the homeroom toe workspace, so there's a chemical cat and cat basically allows you to see the contents of a file quickly without having to, um, open theater or anything. You just want to, like, take a quick lands. So there you go. So if I do can't read me, I see the contents of the file without having to go to the to the editor. Um, if we have a long file, we can also use a command clear the screen called more. So if I do mawr and then read me, um, it basically will Pagine eight because this this file can be seen within only one page. There's not a whole a whole lot off use for it. But if you if you type more and there was more than one page, you can basically see the contents of the file in a paginated manner. Um, one more useful one is called man and man. It's like the manual so you can see the options that you have for any in UNIX or Linux commands. So let's say if I type man CP, I can see the Aled the options that I have for the for the copy command and you can press down arrow or up arrow to see them. The file. Or you can also press the space key and then paginated by page. When you want to exit, you just press the queue, the queue letter and it'll go back out. So, um and that's what basically, it's using the more command, which I was telling you earlier. Um, the last thing I want to talk about is the wild card. So if that they have, let's go to the test folder and let's say, let me create quickly, that's two dot txt and then test three dot txt. And there's something called Wild Car, which is the asterisk. Um, and it's a wanted to move quickly a bunch of files that started with test. If I do move, Test star or ASA is the T Eckstine and I want them in the test in folder, that ass teres is going to say, OK, anything that has that begins with test, no matter what, uh, letters or numbers come afterwards and then after that, a dot and txt are gonna be moved. So if I press enter there, you'll see that, um, I don't have the test. Um, you know files anymore, and they're all in the test in folder. So that's a quick look at terminal commands, and there's many, many more. And there's, like different flags that we can put, which are like parameters for those commands. But you're you learn them ass you as you use them Azaz. We go through the 30 course, but for now, that's Ah, that's a very quick introduction to the terminal commands. 8. Python Shell: So let's start playing a little bit with Python and we're gonna use the terminal again. Time will maximize this here. Um, with cloud nine, we have an option to use sports by Thorn to and buy from three by phone to is still very much in use because there's some libraries that still haven't been ported to buy from three . But I would say these days, most off the off, the useful or most common libraries and frameworks have been updated. So I'm definitely start. And I would start using python three from from this point on, Um and you know, it's it's ah, It's a good thing that we start using by from three projects to, um kind of like move our community or python community towards that, that newer version. So the way we access, if we use only python like this, we're gonna use we're gonna be basically using Python 2.7, which is the the last two version you can do dash V to see to check the version of it. So as you can see by phone, 2.6, 2.7 point six I mean, is what you get from python But we can also use Python three by just typing by from three, and then you'll see that we have 3.4, which is the latest by phone version. So that's that's good. So, um, there's there's a way to play with my iPhone and that's through the python shell. And the way you do that is you just use your state by phone or by from three and then press enter and you'll enter this Ah ah, basically, uh, terminal, where you can play with and do, like, small kind of functions and get to know by son better. So let's start doing some commands and start playing with it. 9. Arithmetic Functions: Okay, the first thing we're gonna do is, um, use by phone as a calculator. Yes. So you get an idea of what things we can do. Um, if I type through plus three, I get five. So, you know, that's that's, ah, basic stuff in there, but, yes, you get a feel for it. So three minus one is to for multiplication. Used to star three times eight for division used to slash 10 divided by two. Ah, One thing you'll notice is that in this operation we got a what's called a floating number . So it wasn't five integer body was five point. Oh, that's because my family is basically kind of like, uh, advancing or forecasting that you might get not, um, integer number. So if we do then divided by three, you'll get 3.3333 which is, you know, the floating number. Um, we can also do, um, exponential by doing two asterisks. So to the power of three is eight. Um, and you can also get the module is which is the reminder of a division. So 10 modules, three iss one because you know, 10 divided by three is three and then you get one more as the, um, seem arduous. Um, the last thing here's like we can, um, group terms together because usually divisions and modifications come before substructure in and addition, for example, if we do two plus three, uh, times five. What will see here is that the multiplication comes first, so it's 15 and then it'll add to two, which is 17. But if we wanted to do the two plus three first you put a parenthesis there and then in that in that case will get two. Plus three is five times five is 25 so that's kind of like basic arithmetic functions. 10. Variables: one key concept in by phone and in other languages is the concept of variables and viable czar basically boxes where you can store, um, some value in it. And then we can reference that value from from that boxes name, so to speak. So let's say if I have, say, a viable called X, you assign it a viable using the equal command, and then you do three. So from now on, X is equal to three. To see the value off a viable, you can use the prin command. So you do print Were you spying this season? Python three used to be print with apprentices X on python to So now we get the value of it . Um, because it's a viable we can change the value whenever we want. So now if I do X equals four and do the print of it, I'll get the do the new value. So as you can see, you can change um, the values off off a viable religiously Um, you can also a sign say we have another viable call. Why? And we can also then now a sine x equals why? And that all that will assign the value off X toe the current value of why, And we'll see why I say that. So if I do print exe now you see that I get seven. But if I change, why toe 10? What do you think? The value of excess the value of X is still the old value. Because this was passed as a value and notice of reference toe the value. So a for for me to change the value of X, I need to, like, reassign x equal. Why X equals y. And then if I do X now, get the updated value. Um, and of course I can. Some those variables, um, explosive y equals 20 um, and you know, do multiplication is and all that. Um another interesting thing is that I can also a sign, uh, strings to viable. So if I do that, say, now Z equals hello. Um, if I pray and see here Ah, you'll see that I have Hello there. And, um, if I have another one, it's a Z Z equals world. If I type c plus zzz, what happens? There is a concatenation. It's not gonna add the values of it, but it's gonna just contaminate the strings. However, notice that we have no spaces in between, which is you know what? We're basically telling it to the self. Refer us to put a space. We would have to do something I z plus quotes plus c z. And then we get the proper hello world. Um, one thing that you cannot do, it's at a a string to a number. We get a an error there because we need to, um, basically convert that one of, you know, the Z toe. Ah ah number which is not possible. But for example, if Z was one right and C c watts equals to two, if I do C plus easy, I get that era. Right? But if I do end of Z, that's basically convert see into an integer and then I do plus easy, Then I don't get the proper result. Um, so that's more or less an introduction to Virals. We're gonna use them a lot, so we're gonna get pretty acquainted with them as we move on to the course 11. Checking Types: a way to check the type off, the viable or the or the number, not the number about the, um the the term that you're you have is through the Taiko man. So, for example, if I do type off one, it says, it's ah, it's a type off integer. So basically it's, ah, it's an integer number. If I don't type 1.0, then type tells me that's a floating them. That means it has, you know, decimals in it. Um, if I do X equals five and then I do type off X, it's as it's it's an integer because it's it's assigning it to, um to an integer number. So that means the viable is inherits the type off, the off the value on If I change that to a string. Um and then I do type X again. I get, you know, the nuclear new classes. It's a string. Um, one thing that do you have noticed maybe is that I can press the type the arrow top and bottom to kind of like go through history so I don't have to, like, retired things again. Um, and once again, you know, if I do type. Hello? Which is a string I'm going to get type off strength. So that's a useful thing. Toe Know and learn. Um, when you want to, like know what? What? The type off a viable that you don't know exactly what what it is? Um, um, kind of like it's Andi. Schools celebrate as just as you see. Very. It says class, we're going to get into classes in later in this section. 12. Variable Format: one thing that you want to get used to, um or know about is something called Pep eight. So if you go to Google and just search for eight, um, and foot Python just in case you'll see this pit eight, um, guideline. And there's basically the style guy for the whole, like by phone coding. And that includes, like, you know how to use code using taps or spaces. What's the maximum lying length? And it basically goes through all the conventions for, um for those, um, you know, functions. Oh, are things that we normally do when I daily basis. So when you have a chance and you have, like, you know, you're having a long lunch and you want to get used to or get acquainted with all the recommendations for for how you know we type code in python, then you should definitely read this. Um, but in any case, um, going back to variables for valuables, we use basically numbers letters and underscores, um, so basically, you know a good noma Good. Ah, viable name is, um you know my var Sony's I use a an underscore whenever I have spaces in there, so I don't do this. My bar, um or do my capital case bar, which is something that jealous refuses. Um, so on the other thing is like try to make viable names as explained, explicit as possible. Like make them meaningful. Don't don't do like, you know, X X. Like I was doing zzz before That was, that was, that's not a good practice. If you're like writing a riel project, it's better to put, you know, you know, database, um, index value versus just like DB I, you know, try to use explicit names, things that you can. People reading the code. I can't understand what's what's going on. Um, there's also like a uh, it's not. None of this is really enforced, but it's it's again what Bebe dictates. We have a constant, which means it's a number that's never gonna change. We use all caps. So, for example, um, data bays ah, name, for example, equals test. So that's that's kind of like it's a good practice to have caps, because that means whenever the person or the developer reading the code looks at that, he knows. Oh, this is something that doesn't change throughout the code base it's it's Ah, it's a cat, it's Ah, it's capital capital life. So that means it's not gonna change, Um, but there's there's all the things that you should definitely look at and take a look at pervade when you have a chance because it's, ah, it's useful for you to get acquainted with it. 13. Strings: Let's take a look at some strength functions. And, um, and helpers. Um, strings can be expressed as quotes like X equals hello or as singles xolo. One thing to know is that strings are basically a raise, and we're going to see a raise, which in pie thunder cold lists in a little bit more detail afterwards. Spot basically think of Honore as a collection off individual characters. So what that means is that if I do, let's say X off zero. That means that I'm going to get the first character off the string. If I do X off one, I get the second. So as you can see, it's basically a collection or array off the strings. H e l l O. And that's something to remember when you you can kind of, like, get the, um, you know, sub strings off off a string by putting a range off characters. For example, if I do zero calling three, I will get the 1st 3 characters off that string, Um, the same way. If I do three through five, I get the last two characters. Um, the thing is, um, as we were seeing earlier, we can con card innate to string. So if I to why equals? Um hey, then we can do explosives. Why? And e get Hello, Paul. Um, if we want to do, like, the the space between the tool I just insert that space in there. Um, we can convert, um, a string that I mean a number toe a stream by using the str function. So, for example, if I have, it's a c equals three. Remember how we said that we cannot come cut in eight? Um, the integer and a number if you wanted to say hello, Uh, three. We would do X plus str off three off z. So str will convert the number three, which is an integer to us strength and their their works. If you wanted to the opposite, remember? Like if we wanted to have a a string that was, um, basically a number we want to get the value of it. Then we do I nt There's also some methods that we can use that are already built in on the strings. For example, if I wanted to have the hello all in uppercase, I would do x dot offer and, um off That doesn't make a lot of sense, I guess. Um, let's say why don't offer and we'll see Paul all in caps and I want to get them all to lower than we do X off lower. So there are more methods like that. But you get an idea off off some things you want to, uh you know, there there are certain my foot. So you can that you can use and one less one that you'll use often is Len, which is what's the length off a specific string. So, Len off. Why is four which is Paul? Um, so, you know, take a look at string operations. When you have a time, there's lots of them, but these are kind of like the ones that are used most after. 14. Lists, Tuples and Dictionaries: So let's take a look at three. Um, very useful types off variables when it's called lists. Um, list is basically a ah, a list of values that can be numbers or strings or both. So let's say X is one common to come on three. Um, and you close them with brackets, and that means that that's a list. So every print exe you get the whole list even to get type X, You get the type class is list, um so least are very useful if you have, ah, basically an ordered or in order kind of like least off values that are, um you need to get access to. And a lot of times, things that come from like the database are are returned as us lift. So you want, like, be able to look through them and get their their viable their their values. One thing you can you're able to do is loop through a list. Um, but that's something that we're gonna we're gonna look at a little bit later. Um, another type, um, or another, uh, yeah, kind of like different storage. Um, Function or or or class is Stupples and Topolsky is basically used with parts. So you can do you know, X equals one comma too. And that's a Topol. So if you do type off X, you get a Topol. So one thing that separates the list on the two poles is that you cannot once a to police, they find you cannot update the values. So it think of a Topol as a constant of, ah constant list or a static list that you cannot change afterwards. Um, to get both a triple and a list value at a specific position. You do basically, um, x off. Let's say the index so actually X off zero, which is this Topol? It's one x of one is is to So it's ah, it's always you always starts the next at zero something that sometimes we forget, Um and what? Basically, you can get any any of the off the values off that off that list or or to pull using that notation. So let's say that, um, we want toe. I want to show you how the we can change the value off off lease, but not of a Topol. So does the find that ex again as 123 If I do X off, one equals four now if I If I print exe, see that I just replaced That won the second value 24 But if I did this Tupelo 1 to 3 and you'll notice that I put a comma after worst, that's kind of like the the way that you work with topples, you have to kind of like ended with with the coma, even though you're not putting a value there. So if I do why off one equals four, I'll get in there because there's no item assignment on totals. Um, the last type that we're going to see is called dictionaries and dictionaries are basically key value, Um, objects. So basically, if I do, let's say, uh, first it first is Jorge and then last ISS Escobar. And then I used Carly brackets for those, so they say is a dictionary and the way you reference it instead of doing X off zero, which you would do in a list, you do X off first, and that will return Jorge. A lot of times these are called objects. Dictionaries are called objects because it's kind of like the first on the last are properties of that object. And, um, and their values are the ones that you put afterwards. Um, the last thing that that we want to see is, um, you can do a list off dictionaries, which is something that you'll see a lot when you're interacting again with with databases . So, for example, let's say we have, you know, users equals and then we have, um let's say, ah, let's to find another another user. Us, uh, why equals first Paul. Ah, and then last