Python for Everybody | Kalob Taulien | Skillshare

Playback Speed

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

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

91 Lessons (9h 23m)
    • 1. Course Introduction

    • 2. Python 2 vs Python 3

    • 3. Where is python used these days?

    • 4. (Windows Only) Installing Python

    • 5. Installing Python

    • 6. (Windows Only) Command Line Crash Course

    • 7. Command Line Crash Course

    • 8. Running Python Code

    • 9. (Windows Only) Jupyter Notebooks

    • 10. Jupyter Notebooks

    • 11. Where to Download the Code

    • 12. Asking Great Questions

    • 13. Taking Notes Beside Code

    • 14. Basic Arithmetic

    • 15. Variables

    • 16. Formatting in Python

    • 17. Python Data Types

    • 18. Mutable Vs Immutable

    • 19. Numbers

    • 20. Strings (Sequences)

    • 21. Lists (Sequences)

    • 22. Indexing And Slicing

    • 23. String Properties And Methods

    • 24. User Input

    • 25. Print Formatting

    • 26. Lists

    • 27. Dictionaries

    • 28. Tuples

    • 29. Sets

    • 30. Booleans

    • 31. None

    • 32. Files

    • 33. Your First Python Program

    • 34. Comparison Operators

    • 35. Comparison Shortcuts

    • 36. Multiple Comparison Operators

    • 37. Chaining Operators Together

    • 38. Introduction to Loops

    • 39. For Loops

    • 40. Looping Through Dictionaries

    • 41. While Loops

    • 42. Break And Continue

    • 43. Type Casting

    • 44. Helpful Operators

    • 45. List Comprehensions

    • 46. Dictionary Comprehensions

    • 47. Functions

    • 48. Args And Kwargs


    • 50. Map

    • 51. Filter

    • 52. Lambda Expressions

    • 53. Scope

    • 54. Welcome to OOP

    • 55. Creating Your First Class

    • 56. Class Attributes

    • 57. Class Methods

    • 58. Real Life OOP Example

    • 59. Class Inheritance

    • 60. Class Interfaces

    • 61. Super Function

    • 62. Dunder Methods

    • 63. Introduction to Packages

    • 64. Installing 3rd Party Packages

    • 65. Finding 3rd Party Packages

    • 66. Seeing Installed Packages

    • 67. Introduction to Modules

    • 68. Creating a Package

    • 69. Name and Main

    • 70. Errors and Exceptions

    • 71. Catching Exceptions

    • 72. Unit Tests

    • 73. Nested Functions

    • 74. Decorators

    • 75. Generators

    • 76. Linting

    • 77. Virtual Environments

    • 78. Requirement Files

    • 79. Interactive Python

    • 80. Python Versions

    • 81. Local Server

    • 82. Project: Demonstration

    • 83. Project: Python Environment

    • 84. Project: Required Packages

    • 85. Project: Custom Machine Learning Model

    • 86. Project: The Code

    • 87. Project: First Detection

    • 88. Project: Second Detection

    • 89. Project: Confidence Matters

    • 90. Project: How to Learn More

    • 91. Summary

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

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

Welcome to Python for Everybody, the complete Python course for beginners, intermediate and advanced developers. 

Python is the #3 most popular programming language on Earth. There's no software that Python isn't involved in. Whether you want to get into Data Science, Machine Learning, Artificial Intelligence, Web Development, Video Games or anything else, Python is the language you'll want to learn. This course is designed to set you up for success in every Python-related industry.

If you are new to programming, Python is the perfect language to learn first. It's easy to read and write and the learning curve is very low making it the ideal first-language to learn. 

If you're coming in from another language such as C or Java, you'll pick up on Python even easier! Python takes care of all the little things behind the scenes so you can focus on writing clean code that performs well. 

In this course we'll learn about variables, data structures, conditionals, loops, functions, Object Oriented Programming (OOP), classes, interfaces, the Python 3rd party package ecosystem, virtual environments, decorators, generators, try and except, and unit testing your code. Plus everything between the major learning points. 

This course comes with interactive coding notebooks so you can test out every piece of code I write in this course, you can edit it and experiment safely, and take notes beside your interactive code. It's the perfect way to learn! 

Who is this course for?

This course is designed for everybody, even if you've never written a line of code in your life. But specifically, if you want to get into web development, machine learning or data science, this course is for you! 


You'll need the internet to stream all the videos, and a computer (laptop or desktop) to write the code (you need a real keyboard, a phone isn't a great coding experience). 

You'll also need Jupyter Notebooks, or a text editor like VS Code. VS Code is a free download. 

Lastly, you'll need to download and install Python. Python is also free. And you'll learn how to download and install Python on your computer in this course.

Your project:

At the end of the course is a VERY LARGE project. It's roughly 8 videos long and I'll guide you through making an image recognition application using Machine Learning and Python. 

Meet Your Teacher

Teacher Profile Image

Kalob Taulien

Web Development Teacher


Hi everybody! I'm Kalob Taulien.


Here's the TL;DR (short) version about me:

I have been coding since 1999 and teaching people how to code since 2013 I have over 350,000 web development students world-wide I'm on the Wagtail CMS core development team (Wagtail is Python's #1 most popular website making system) I try my best to answer EVERY question my students have  I love teaching — it's definitely one of my natural talents  Also I love goats! (Great conversation starter with me if we ever get to meet in person)

Below you can find all my Skillshare courses. The categories go from easiest to hardest, except for the Misc. Coding Courses at the very end. 

If you're brand new to coding, start with BEGINNERS WEB DEV.&nb... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

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. Course Introduction: welcome to Python for everybody on skill share. This course is designed to take you from zero to hero in Python. I've designed this course to be your best resource for learning python, So why should you learn python? Well, Python is one of the fastest growing programming languages on the planet. It is currently the third most popular programming language in the entire world, and it is used in every corner of software such as Web development, machine learning, artificial intelligence, data, science, machine vision like self driving cars, your everyday computer programs, video games and much more. Python can help you build anything you can think of. It's easy to learn and incredibly powerful. That's why so many universities are teaching python these days. Now who is this course for things? Courses designed for people who are brand new to programming Python for everybody is good for programmers coming in from another language. And this course is also approachable for people who already know basic python but wants a level of their skills with more advanced topics in this course. Now you might be thinking, What is this course like in this course, I will show you how to set a python and a coding environment on Windows, Mac OS and Linux. Then we'll step through the basics of python like formatting or code simple arithmetic and working with computer logic. Then, as you continue to a level up, you will learn everything from beginner python toe advanced python that you won't find in many other courses, such as object oriented programming, decorators, generators, unit testing and more. Through this course, you will have interactive notebooks to experiment with and to test your understanding. I will also provide you with detailed notebooks for your reference. And these notebooks are unique because you can write your notes alongside fully functional code there over 70 super high quality lectures and interactive notebooks and python for everybody. And you will also learn python best practices. And by the end of this course, you'll be confident enough to put Pike on on your resume. Now, when you enroll in this course, you will also get access to a huge community of programmers alongside riel. Question and answers, and you get to ask me the teacher questions at any given time, and I will answer every single one of them as a thank you for trying of this course. You can even keep all the interactive notes for more details about this course. You could further explore this landing page, read the full description and view the entire course curriculum. So what are you waiting for? It's time to start programming enrolled today and let's get started. 2. Python 2 vs Python 3: Let's take a quick look at the difference between Python to and python three. So in this course, we're actually not going to be learning about Python to whatsoever. Python to is completely outdated. Actually, as of January 1st 2020 Python to is outdated, and it is no longer receiving security updates whatsoever. So if you have, by any chance a program that's using Python to instead of Python three please up, created as it is now a security risk. And once again we're just not going to be using Python to it all because it is outdated, it's not supported. Nobody's supposed to be using it anymore at all. Anyways, eso in this course, we're going to be learning Python three. And to be more specific, we're going to be learning about Python 3.63 point 73.8. So newer versions of Python Python three right now is the current future, which is a weird thing to say. It's the current future. Eventually, I'm sure Python four will be the actual future, but just once again, we're not using python to whatsoever. And if you are enrolled in another course that is using python to. You don't have to pay attention to any of that stuff because most of Python three is very similar to Python to behind the scenes. There's some differences, but for the most part you're not really going to see too many differences now if in the future you're ever Googling a problem and you see this print statement where just as print and then space and quotations that is Python two. That is how you immediately tell that someone is writing Python to were not Python three. Python three looks like this print statement where there is print a bracket and then quotations and then some text inside of it. It has the brackets, so just a side by side comparison here, we've got python to print statement python three print statement, and that is the quickest way to identify if someone is writing python to or python three. There are some syntactical differences in python to versus python three, such as using brackets or no brackets for the print statement, but for the most part it is very, very similar. So when you learn Python three, you are learning about 95% of python to as well 3. Where is python used these days?: Let's take a look at a few places that you can use Python. It's actually not a few places because Python is actually so popular. It is deeply embedded in every single corner of software these days. And as of recording, this Python is actually the third most popular programming language in the world. And I'm just loading up a website here that says, Ah, up, up up of, Ah, the Tai O. B. I don't know how to say that index for April 2020 and we can see some growth here. So last year, Python was number four. This year it is number three, and it's ratings are 9.31 It's change. It's gone up by 1.15% which doesn't seem like a lot. But look at Ruby. Ruby went down by 0.2 Go went up by 0.35% and even JavaScript JavaScript is a really hot language. But year over year, it doesn't seem to be growing so far, not over. Not between 20 19 and 2020. Javascript is still the seventh most popular language in the world, which is huge. It is a very very popular programming language, but Python is number three. It is significantly more popular. So just as an example, a few places that you can use python and again these are just a few places. But let's start off with some of the cooler stuff, right. Python is used in machine learning. Python is used in artificial intelligence. Universities are all teaching python these days because it is simple, like it's easy to learn. It doesn't come with all sorts of like crazy things to look at. Its just. You can read it like a book, but it's also super super powerful, so it's simple and powerful. That's why universities are teaching at these days. You can also use it in data science. Raspberry PiS. You can use it in things like automation and robots. You can use python for things like image detection and machine vision. So, like self driving cars, for instance, which is absolutely the future. But also you can use it in things like Web development or small little programs or Web scraping programs or automating anything in your house literally anything to do with software. You can use python now. One other thing toe really think about here, and I know this is not a big motivator for a lot of people, but it is worth mentioning. Python programmers make more money than most other languages. So, for instance, if you were a Web developer and you already know PHP, while Python developer sent to make 2 to 3 times more money than a PHP developer, Python developers also tend to make 50% up to two times more money than JavaScript developers than front end Web developers. So you can see right away that Python already wins when it comes to economics. Now that number. Actually, it's even higher when we start talking about machine learning, artificial intelligence and data science. So if you have any sort of mathematics background or any sort of interest in machine learning or artificial intelligence or data science, when we talk about annual salaries, we could be looking at 121 151 $180,000 a year. Those air U. S. Dollars and most of that these days is python as well. There's also a ton of different jobs for python, like a lot of different jobs. So as an example, I'll just go into my brows here. Go to indeed dot com, and I'm just going to type in Python. Uh, let's just do a regular one. You're something they suggest. Let's do you have a python developer? Find a job? Okay, there are 25 a half 1000 jobs in the United States for a generic python developer right now , that's very impressive, because as of recording this last week, the United States had a record 6.6 million people file for unemployment. And that's because again, as of recording, this is in the middle of the Corona virus pandemic. So people are losing their jobs very quickly, and there are still a ton of python jobs out there. That's crazy. Let's look at remote work because nowadays everyone wants to work from home. I work from home, and it is a fantastic lifestyle. In the US There are 4600 python remote jobs, thes air, just jobs that actually say remote, either in the title or somewhere in the description. There's probably actually way more than that, their entire companies, like get Lab that aren't 100% remote as well, so you can work from home. Let's look at Python Web developments. Look at this one in the U. S. There, almost 16,000 jobs for Python Web development. Now let's look at some of these salary estimates. Al, just zoom in here. Salary estimate. This is for the Python Web developer. Ah, we've got over 2000 jobs here, 20 2700 jobs that are paying over $135,000 a year. The lowest bracket here is $90,000 for 13,000 jobs is not crazy. What about if we just went back to the generic one Python developer, 21,000 jobs paying $90,000? And there are more jobs in your lots of full time jobs and contract jobs. Part time jobs, internships, temporary jobs, commission jobs. I don't actually really know how you do a commission job with software that's interesting but full time contract, part time internship and temporary. There are jobs to fit your needs or whether you just started a family or your sick or you have a disability and you can't go to an office. Python is a programming language that can give you a lot of opportunity in your life. And again, I know that money is not supposed to be the biggest motivator out there. But for most people, making $100,000 a year is a lot of money and attacking provide for you and your family and can provide a lot of comfort in your life. So when people say things like, Hey, Caleb, should I really be learning Python like maybe maybe I should be learning Go or rust or something else. My answer is, yeah, you should be learning Python first. It is easy to learn. It is powerful. It pays well. It is a great entry language into programming. You can literally do anything with it. So my answer is Yes, yes, yes, A 1,000,000 times, Yes, learn python. There's so much opportunity out there for it. Stick with it and you will break into the industry. I can guarantee you that 4. (Windows Only) Installing Python: Hello, Windows User, If you are not using a Windows computer, then this video is not for you. However, if you are one of the people in the world who are using Windows, which is a lot of people like 60% of the world uses windows or something like that. You might be interested in learning how to install python on Windows. I'm using Windows 10 and also installing Anaconda along with how to run some python commands. So I just thought I would make a proper support video specifically for Windows users. So first things first we need to download Python. And so I'm gonna open up whichever browser, and I'm gonna go to python dot or go. I guess we can make this, you know, touch bigger and let's head on over to downloads. And now it's gonna automatically suggest which version to download for me. So I'm gonna download Python 3.8 point two and I can save it and I can run it. And all sorts of stuff obviously take security measures into account here. I'm just going to run this because I already have anti virus and all that stuff running on here If you don't, you may want to look into that just toe, you know, be safe on the Internet. All right, so let's go ahead and install Python. So this just automatically detected 32 bit for me. If you're using a newer computer, definitely get the 64 bit, if that is an option. And also, you're going to want to add that python path in there, so make sure you click this little box. So I'm just going to select the install now. Yes, and the set up is in progress. We'll just wait for it to do its thing here. Okay. Says the you set up was successful. Thank you. Marc Hammond, for all your work. Ah, disabled half length limit. That's usually a good idea. Commit Click that it's gonna ask me. Yep. I'm going to confirm that and clothes. And now Python is installed so I can go in here, and I could just type in command prompt, and you can see it here. And I'm going to run this as an administrator just so that I have proper permissions again . It's gonna ask me Do you want to do this? Yes, I do. And now typically throw the rest this course and throat. Ah, a lot of other videos you'll see on the Internet. You will see people say, Ah, they'll type Python Dash V or dash dash version like this, But that's not going to work for us, not on Windows anyways. We could do Python Dash V that also isn't going to work on Windows and said, What we use is just P Y soapy y Dash V, and it gives us the version that we're using P. Y dash dash version, and that gives us all of our regular python command. So what we can do now is instead of typing python or occasionally python three or python 3.6, and then whatever your version, your command is not your version. But whatever your command is, you just type pie. So if you're running a python file, you would rain. You'd run pie, your file dot pie, and that's it. Now your file DuPuy doesn't exist, so that's not actually going to do anything for us. But moving forward. If you run into a python file, you can always run it with just pie. Also getting into your shell. This is pretty important to know just getting into your python shelters two different ways . You can do this the first ways you can just type pie and hit. Enter and you can quit by hitting or typing. Quit with the parentheses around it. Here, you can go down here and it'll say, recently added, Or if it's not in here, it will be somewhere in here how you can just click Idol and this will spin up python for me. And so this looks a little bit different, but this is just appear Python. So this is not your command line. This is just Pierre Python. And so now I can print Hello World, and it gives me nice little helpful tips like what we saw there. And I can print that in a sign of variable python for everybody. And I can print that out as well. And Willa, And if I want to get out of it, you can just close us as a program, or you can type quit with parentheses and yet cool. So that's how you would download and install python on windows and also how you would run it in your command, prompt and in your python Idol 5. Installing Python: Okay, let's take a look at installing Python. A lot of computers actually already come with Python. If you're on a Mac, it probably already came with Python to maybe a version of Python three. Ah, lot of Windows computers these days come with Python as well. Lennox probably already has Python, but let's not. Let's not make any assumptions here. So what I want you to do is open up your browser and go to python dot org's and you see this website that looks like it hasn't changed since 1998 and let's go to downloads. And the latest version, and this has detected that I'm already on a Mac computer is 3.8 point two. So is going to suggest that I download this. You could download the suggested version as well for your operating system, or you could scroll down a little bit and you can download a different version so you can see we have all these different versions. There's lots of them in here, so I'm going to highly recommend that you download either python 3.7 or 3.8 or if you're watching this a little bit after recording of this course and python 3.9 to 3.10 is out. Download the latest version, so I'm gonna suggest getting Python 3.8 point two right now. And if you click this, it's actually to bring me down to a page. Will bring you down to a page, I guess to, and you have to scroll down to the bottom. And if you're on Windows, you'll probably want these 64 bit execute herbal installer. That's going to be the easiest way to install Python on Windows. If you're on Mac, you probably want to the Mac OS 64 bit installer. That's probably going to be the easiest way. And if you are on some sort of UNIX type system, also known as Lennox Ah, you could download or curl the source Tar ball or the G zipped source. Tar ball un compress it and install it. So once you have python downloaded and installed, you need both of them. Download and install it. Then let's head onto that next lesson. But don't move onto the next lesson until you absolutely have python downloaded and installed 6. (Windows Only) Command Line Crash Course: Okay, let's do a quick little crash course. A command line. Crash course, four windows. So throughout this course and through a lot of other videos on the Internet, you're going to see a lot of UNIX like commands. So commands like ls or ls Dash L. A. And that clearly is not going to work in our command, prompt. And just to take a quick step back there if you're wondering, OK, love, What is a command prompt Command prompt is when I go down here in type command prompt. You can run this as an administrator. It might ask you. Are you sure? You say yes. You click the yes button, and it will bring you to something like this. So if you want to see everything that's in a folder instead of L s Dash L. A. Which is what you'll often see on the Internet, you can write de ir dirt, and this will show you everything inside of a directory. And look at all that. I have a lot of things inside of this directory. Now, which directory on my own? I am on. See Dr Windows System 32. How to change your directory you can type CD to change your directory. Dot dot dash will move you up one director, and you can actually see that is changing here. I could do that again. CD dot dot dash goes up a directory and I can do D IRC What's in here About a few things, but I will usually want to go to the users because that's usually where you're going to be working out of is your user profile. So you do CD users and then I can do. I eat during here and I have a user called Caleb and a directory called Public. So a directory called Killed in Public. So that's CD Caleb, and this is likely going to say whatever your name is on Windows ER, and I can see all sorts of files in here. Now let's say you wanted a folder just for your projects. You could make a directory so NK and then directory D i R. And then you could call it like your projects. If I do D r D I r. You'll see the full during year called your projects. So now I can go in there CD your projects change directory into your projects de ir. You'll see there's nothing in here zero bytes and I can create a new python filing here if I wanted to. Now I'm also inside of my profile at this point. So if you're using Thea's code or pie charm or some sort of text editor, you can put all of your files in here and you'll be able to see them as well. And just, for instance, I created a folder called Your Projects Inside of My Accounts. Let's go explore that. Let's go to my documents and that's kind of cool. I did not realize that would be there, but there's Python scripts already in there. Let's go, Teoh pc See Dr Users. And this is just matching this location down here. It's gonna go into Caleb and I'll have a folder there. It is your projects. And then you could create a new filing here. You could open up your text editor, your code editor. You could create a new project, and here you do all sorts of stuff in here. But the main thing to know at this point is really you need to know. How do you change directories? Go up a level you need to be able to go into a directory. So it's just like CD. Whatever your folder is called, you need to know what is in your directory or in your folder with de IR there just like that. And then, lastly, you need to be able to run your python files, and running your python files is as easy as P y and then your file dot pie. So your file dot pie, assuming your file dot pie actually exists. Last but not least, you might want to get into your python shell your python idol. All you have to do is type P Y, and you can write all of your own python in here as well. If you ever get stuck in here and you want to get out, you just type. Quit opening and closing parentheses and you will get out of it as well. If at any point in time, you like Oh, no, actually close this. That's not a problem. Let's go back here and find your command prompt. I always like to run this as an administrator. Yep, and we're back to where we usually start off so that is a quick command line crash course on windows. You don't really need to know too much more other than that for the rest of this course. 7. Command Line Crash Course: okey dokey. At this point time. You should have Python installed already, and it's now time for a quick lesson on some command line basics. So if you are on a Mac, there's a program called Terminal and pretty much every Mac comes with this, and you can find it by hitting command space and then just typing terminal dot app or just terminal and then go to terminal app and that will open up your command line program for you. If you're on Windows, you'll probably have a program called Command or Power Shell, where you can download one called Commander cmd er, and that will be a command line program that you use for the rest. Of course, as well. If you're on Lenox, there's a program called Bash, but there's also a ton of other programs other that you can install likewise for Windows and Mac OS as well. So, really, if you don't want to use what's already on your computer and every computer will come with a command line program, you can download and saw a different program. Okay, so I've just zoomed in on my terminal here so you can see what's going on And for a quick little command line crash course, there's a few things you're going to need to know. You need to know how to list files in a directory. So on UNIX based systems, so limits and Mac, you can usually type ls Dash L. A. And it will show you all sorts of things in here. You can see I've already got Ah Fuller called Python for everybody. Uh, where is one that I would want to go into? Let's go into movies. So let's say I can see that there's a folder and they're called movies and I want to get into it. I can type CD and then the name of the folder, and now I am inside of it. And most programs will also tell you which directory urine as well. Ah, directory is a folder, by the way. If you did not know that now, just going back a quick sec I did the example of ls Dash L. A. If you were on Windows, your command is going to be different. It's going to be D I r dir and dear will show you all of your files and folders the same way that ls Dash L. A. Does for me. So let's CD into a directory called movies. That's just change directory. You can use this on all operating systems. A CD just means change directories. PWD will show you exactly what directory you're in. So I'm in the user's directory. Caleb Tallinn movies. If you're on Windows, this is going to look a little different. This also say something like, uh, See, Dr, I remember exactly where it is. Users. I would be Caleb Colleen movies something along those lines. Anyways, that's what you'll see on Windows and on Lennox. That might actually just look like slash home slash Caleb Colleen slash movies. And it was something like that. So that's how you see where you currently are, is pwd. Now let's say you wanted to make a directory, and this is going to be important eventually down the road. So if I do ls Dash L. A order on Windows. I can see that I have a few files in here. None of them are really important. If I wanted to make a new directory, I could do M Kader that sense for make directory and let's call it a test Dir a last dash L . A or Deron Windows, and you can see that there is a new directory in here and I can change directories into their and do P W. D. Now, if you are in a directory and you want to move out of it, you can always you change. Directory dot, dot, slash and that will move you up a directory. You can do it again. CD dot dot slash moves you up a directory. And if you ever wanted to move into multiple directories, you could do CD movies and then whatever the other directory is. So a sub folder subdirectory. And for a lot of cases, you can just usually type most of the word hit tab, and it will auto complete for you. So seedy Movies Test directory. I moved into two folders at the same time there. Cd dot dot slash dot, dot slash will. Bring me out of test directory out of movies and back into my main location, Which for me, is users slash Caleb telling one last one you're going to need to know is Python Python is a command. Let me clear this out as well. Python is a command you're going to need to run. And it's probably a good idea to try to figure out what version of quite thing you have right now by typing Python Dash Capital V and you can see I'm using Python 3.7 point two. You might be using python 3.73 point 83.9 something newer if you see how do you do? Yeah, if you see Python 2.7 point something, or rather without having to type Python to. If it just shows this in here, when you run this command, that could be a problem. So for me, I just need to type Python and it assumes Python three. If your computer is not assuming Python three, you might have to type Python three Dash V and you can actually see because I'm using multiple versions of Python. If I use Python three instead of just the word, Python uses Python 3.8, and again, that's just because I have multiple versions of Python on my computer. There's also another way. If you have Python 3.7, you could do Python 3.7 Dash V, and we'll show you and I don't even know if I have Python 3.6 on here anymore. Turns out I don't, but I could insult with Pie N. That's something we can talk about. Down the road is multiple versions, but the thing to take away here is if Python Dash V says Python to point something, rather, you might want to try Python three Dash V and moving forward. You're going to want to use Python three, your file dot pie. We'll talk about that again in the future lesson, but that's just something to be aware of on the command line as well. 8. Running Python Code: There are lots of different ways to run your python code, but when you get into an actual job, you're going to be using your command line more than anything else. And so in this course, we're actually going to look over two different ways. We're going toe, go over rather two different ways of running your python code. The 1st 1 is the command line, which I really want you to get familiar with just at the very beginning. And the second way is using a Jupiter notebook, which will cover in a different lesson. But for now, what I would like you to do is open up your terminal or your command line program. For me, it's called Terminal. If you're in Windows, that's probably command commander or power shell. And if you are on Lenox, it's probably like Bash or some custom terminal that you've downloaded on your own. And let's go ahead and take Python Dash V, and that's going to show us the current version of Python we're working with. We can also take which python, and it will show us exactly where the Python program is being called upon. Now that's actually not super important mines going to say pie end of shims because I'm using pi N viewers might say something totally different, but regardless, it will say something that's not actually writing any python code. That's actually just figuring out where Python is insult on her computer and showing us the version to get into Python R Python Shell, where we can actually write python. Just type the word python and hit Enter. And here we can see that I'm using Python 3.7 point two. I think this is when I set the default. I'm not entirely sure why that is so far behind to be totally hottest. Ah, but there there's a little helping here as well. Eso type, help copyright credits or license for more information. Let's type help. Okay, type help parentheses for interactive help or help object for help about objects. We don't know about objects yet, so let's just keep this imbalance type help with parentheses, and it gives us a bunch of information in here. This is kind of cool. Welcome to Python 3.7 help utility to get a list of available modules, keywords, symbols, topics, type modules, keyword symbols and topics Let's type modules. Now. We aren't going to learn what all these are right away. This is just sort of exploring the command line a little bit. And so that showed me some stuff. That's kind of cool, but I want to get out of here. So let's type quit did nothing. Or so it seems it did nothing. What actually did was get rid of the help tool that we were inside of, So we were technically inside of a program in our command line. Now, help is a super useful function when you're just learning python. But to be totally honest, it is not Superfund. I can't run clear because I'm not actually on my command line. I'm actually inside of Python, so I'm gonna clear up some of this stuff. And to write your first Python script is incredibly simple. So type of the word print with the parentheses and opening parentheses, use a quotation mark and say Hello. World ended with another quotation marks. We've got an opening one right here, and we have Sorry, we haven't opening one right here and we have a closing one over here. Same thing with parentheses. We have one here and we have one here. Go ahead. Hit. Enter says, Hello world. And just like that, if you have followed that along on your computer, you have actually written python. It's literally that easy. So right now we're inside of our python interactive shell. We can do all sorts of python stuff in here, and we're going to be using this and Jupiter notebook throughout the rest. Of course, as well. Now, to get rid of this to get outside of this because currently were stuck in like a python program, just type. Quit with opening and closing parentheses and you'll get outside of your python program. And to get back in simply, just type python quit. And if you are one of the unlucky people who has a type Python three in order to see the Python three program actually execute on your computer, you simply just type Python three and that will go into your python three showing you can actually see for me that changed my version of python as well to python 3.8 and same thing quit. Now, last thing to note is, python files are usually stored in some sort of python file dot pie file the dot pies The extension here, that's the important part. And to run your Python file is simply just running python and then the file name. And so this is getting into command line stuff again because this is the program you want to call, and this is the first argument you're saying, Hey, run Python. But don't just give me the show. Actually run This file knows file doesn't exist. We'll get into that a little bit later, but that is how you would run a python file one last thing to keep in mind again. We'll talk about this much more. Down the road is python is case sensitive, and it's also indentation sensitive, so we don't use things like curly braces like you see in JavaScript or PHP or in a lot of different languages. We don't really use curly braces too much in python and said, we use indentation, makes her code nice and easy to read makes it nice and easy to debug. And honestly, a lot of people really love the fact that it uses indentation rather than curly braces. I love it. I thought it was weird at first but I actually love it now, and it is so much better than right and curly braces everywhere. So what I would like you to do is open up your command line program tape and python type in print. Hello, world. Just like I did hit, Enter and you'll see. Hello World, then quit. Once you've done that, you've successfully written in Python and it is time to move on to the next lesson. 9. (Windows Only) Jupyter Notebooks: Let's go ahead and download Anaconda so we can run Jupiter notebooks. So what we need to do is go to Anna Conda. I think it's dot com. Let's not risk that. And a condom Python and Google will know or being, because Windows that makes sense does anaconda dot com. So we want to go into products and let's go into our individual edition here. And let's just get rid of that and make her pages the touch smaller here. And so really, all we want to do is just download this. And for this one, I'm going to download the 64 bit graphical installer using Python 3.7. So so again, you can save this scanning for viruses and just run it. Okay, honest Anaconda is up and running. I'm going to install it now. Agree? Just me. Sure ill and sell it into my account. Now, if you want to use Anaconda, you can you can say register. Anaconda three is my default Python three. Now I've already installed Python I using python 3.8, so I want to use that. But if you just want to use python this way, that's totally cool too. Something a go through here is going to install. Okay, so for me, that took, like, five minutes. That was very of long set up. Ah, but it is finally done. Click next. You want to get a python specific editor called Pie Charm? You totally can. I don't. I use V s code because I'm a little more full stack. And I liked rice. JavaScript, html CSS, SQL, Django. All sorts of stuff. All right, now that that is installed, we can go into our Anaconda three folder here and go to Anaconda Navigator. That's the one we want is the navigator. So this is asking if I want to help Anaconda improve. I currently don't, but you might want to. Okay. And don't show again and let's go back to our program back here and we can see all sorts of stuff now your screens probably going to be a little bit bigger than mine. But you're going to see all sorts of stuff in here, and the one we're going to be using for the most part, is going to be notebook. She's going to want to click launch on that now. What's really cool about this is You can run python right in your browser. So I just ran this from Ah, standard folder and you can traversed through your folders and creates new python files anywhere you like. So, for instance, if I wanted to go to my desktop and create a new python filing here, I could I would just go over here New Python three. And now you and I are using Jupiter notebook on Windows and we can check that this is going to work by typing something like Print Hello world. And then you can just run yourself and it says, Hello world. Once you have that up and running, you successfully are using python with Jupiter as well. We can also check to see what version of Python were using by executing the command line command with an exclamation mark P Y dash dash version. And what this does is says, Hey, actually, get out of Python for a quick second. Just run this on the command line Run P Y dash dash version, and this will do Python 3.8 point two for us. That's how I know what version of python amusing at any point in time. You can always save your file. You can rename your file. You can do all sorts of stuff. If you ever wanted to, you could just totally killed this, Colonel. So what, you're running in this particular window is called a colonel and shut down our Colonel. All we have to do is shut down. Yep. Shut it down. And now we can see there's no colonel in here, But if we go back to this tab, we have a new file called untitled dot i p Y N b. So that's all there is to installing Anaconda and Jupiter notebook. 10. Jupyter Notebooks: there's another way to run your python code. You don't have to do it through a command line, although I like the command line just because I've been exposed to it for so long. But if your brand new the command line, can be very overwhelming, another way is to use this thing called a Jupiter notebook. Jupiter dot or guy believe, is the website J u P Y T e r. And if we just click on install, there are a few different ways to install Jupiter notebook. So if you're already familiar with some python, you have a little bit of background. With python, you can just simply do Pip install Jupiter Lab or Pip Install notebook. Now, chances are you probably don't have that kind of experience right now, and that's okay. If you don't, you can go to ah, Anaconda. I don't actually remember what this website is. I think it's anaconda dot com. Yes, anaconda dot com. So Anaconda is a python distribution. It also comes with a lot of different tools. So if we click on download you can download four Windows Mac and Linux. It will install python for you. It will also install a bunch of other things for you as well, including a Jupiter notebook. So just scroll on down. Click python 3.7, or if 3.8 or 3.9 is out, Go ahead, click that, download it and install it. Okay, So I'm just booting up Anaconda here, and you're going to see once this loads it comes with a bunch of stuff. It comes with things like V s code, our studio and Jupiter notebook. This is the one we want. I'm gonna click launch here and that spun up my terminal and is going to run the command line command from Terminal. And here we have Jupiter Notebook. Yes, is probably be pretty hard to see on a smaller videos. Let me zoom in here. A Jupiter notebook is basically an interactive way to go through different files and create these things called interactive python notebooks. No, I have a folder in here called Python for everybody. This is where I'm going to be keeping all of my code now to create a new file. All you have to do is click this new go to Python three. I have Django installed. So it's going to say this. It might not say that for you, Python three and we're going to see this cool little thing. Now, this doesn't look like much to begin with. However, if we run that print statement we saw in the last video Hello world and we hit shift, enter, We can see Hello, world. Now let's just walk through Jupiter notebook a little bit because this is not super intuitive. So let's first turn on our ah toolbar. Here we go. So you can go into a cell here and you can change. This text changed and you can rerun it. You just click run and it will rerun your code for you, which is really nice. You can actually go back and do this over and over and over again. Let's go ahead and turn on our line numbers here. So in this cell, we've got line number one just as print Hello. World changed down the road. You're going to see me? Ah, use something called Mark down and it will just say hello. This is ah title, and there's actually no code to execute its just mark down. So that is a markdown. So usually we're going to stick with regular code cells. There's also a bunch of shortcuts here. Ah, which, if you are a short cut ninja, you probably want to learn most of these because there's some nice shortcuts in here, like how to delete us out, how to move up and down to sell things like that. The most part, we actually don't need to know a lot of that in this course because we're just going to be using these cells to really explore Python. Let's go ahead, change up and rerun it. Now I'm going to save this file and you can save your file as well by going to file. And this is all just done in the browser. So this is not actually in my browsers files settings. This is in what looks like a websites browser settings, so I go to file save As and let's just call this first notebook. Now, I'm actually not going to make this publicly accessible because this one is just going to throw this file way. It's not useful for anything, but this is how you actually save one. So this is the folder that I'm in. I wasn't called first notebook dot i p y and be save. And just like that, it saved it doesn't look like it did anything. And it could change title of it up here if I wanted to. But whenever you see some of my coat and I'll show you where to download all of my code down the road, you want to do file open and then you can open. Let's say first notebook dot i p Y N b and you can see all of my code and execute all of my code as well. Now, last but not least, sometimes you want to run something from the command line. This is not your command line program. This is simply python. This that's all this is. This is a little interactive way of working with python. But if you needed to run something from the command line, you have two options here. You can either open up your terminal. I've got to open one that I'm writing code on and one for Jupiter notebook that runs behind the scenes. Or you gonna type exclamation mark and then whatever your command is going to be, so mind is going to be exclamation Mark Python dash fee. And that's just going to show me the version of Python that I'm currently using and hit, shift, enter and says Python, 3.7 point two Last but not least, there is a way to actually theme this. So if you don't like all the bright colors and and the light grays, you can actually theme this in your command line. You could do Pip install Jupiter themes and then, yeah, see its installing Jupiter themes for me. Okay, Cool. So did a bunch of stuff, and then you could run. I think it's J T Dash T. And then the name of the theme. Something like that. You'll have to look into that on your own because I'm just going to use this standard version just so it keeps it nice and simple and as I don't really want to blow this course with too many things. But I do want to show you that you can change the theme of this so it looks a little nicer . Maybe it looks more like your regular text editor so you can do that as well. I think one of them is actually, uh, more okay, I have no idea how to spell that, right. But you could do something like that. And then you just shut down notebook and start it up again from scratch, and it will look different anyways. That is a Jupiter notebook. In a nutshell. If you want to, you can go ahead and you can explore all the different cells, things that you can do, the commands, your command palette or all your shortcuts. You could search through them. You can create new files. You can cut text. You can move up and down cells and do all sorts of stuff in here. So for the good majority of this course, we're going to be using a Jupiter notebook. And when it comes to learning Python, I would highly recommend downloading Jupiter or Anaconda and using Jupiter notebook. Just that you can learn and tinker with python. You don't have to worry about retyping anything. You can always just come back and you can undo something. Rerun the cell with shift enter. I wanted to get rid of it. Get rid of that one. Get rid of that one. Care to that one. So I just deleted cells using a shortcut. So no big deal and if again, you ever wanted to changed again. If you ever wanted to change something, it will just automatically run for you. It's very, very nice tool toe have you don't have to worry about retyping anything, so definitely, definitely. Get Jupiter notebook. It's completely free, but if you don't want to, you can always just use the standard python interactive shell. 11. Where to Download the Code: all right. Before we get started, let's talk about where you can find this code. So you condone. Download all of the Jupiter notebooks from the resource files on this platform. Now, if you happen to be taking this course on a platform that doesn't have the resource files, you can always go to get hub dot com. And if you look up in the URL here, you'll be able to find exactly where all these files are all the code for all the lessons if there is any coat is all available here on Get Hub for free. You can also download it by either running get clone or or you can download all the files in a big zip and then once you have it downloaded or cloned, you can either extract the files. If you ended up downloading the ZIP, you'll need to extract the files or you'll need to CD into your Newgate project, the one that you just clone down. You need to see the into it with your terminal or your command line program, and then you could run, for example, a python file with Python, my program dot pie or if it's a Jupiter Notebook file. You can open it in your Jupiter notebook as long as it ends in dot high p. Why nb last but not least, you can also view all the interactive python, the Jupiter notebook files here on Get Hub as well. You can just click into one of these and get Hubble show you probably something very similar to what you'll see in the videos. So there are several places that you can download the code. I would highly recommend downloading the code and just taking a look at what I have written and feel free to break stuff. And honestly, if you break something or you can't undo something, you can always just re download the code, and that's okay. Once you have the code on your computer, let's head on over to that next lesson. 12. Asking Great Questions: Hello and welcome to Python for everybody. First and foremost, Thank you for taking my course. I appreciate that there are other Python courses out there, and you've decided to take a chance on my course, and I just want to say I appreciate that. With that said, I have a couple of rules that can help you ask questions better. And the reason I'm bringing this up is because if you ask a question, I want to give you a good answer in a timely manner. So the first rule is, Please write your questions clearly, so ask what your question is. But if if it's about a certain problem, make sure you describe what that problem is or if it's about a certain piece of code, make sure you reference what that certain code is. The second rule is, if you are going to share code, please make sure that the code is formatted. If you formatted, then I can simply copy and paste it into my command line or into a python file, and I can run it very, very quickly and get you an answer very, very quickly. You can use a service like paste bin or if the comments down below allow you to you can also use code formatting in there, the third room that I would like to put out there. It's actually not really a rule. It's more of a guideline, but the 3rd 1 is always provide your version of Python python. Every new version of Python comes with new features, and so if you're trying to use a feature on an older version of python, it helps me to know which version you're using. And if you don't know, you can always open up your command line and you can type Python Dash V, and it will tell you something like 3.7 point two. So if you could please provide your version of python as well, that just helps me with debugging a little faster. And last, but not least, if you're asking a question about a particular video or something you saw in a video, if you could please tell me which video you're referencing and which time you're referring to In that video, I have a few videos that are upwards to 15 minutes long, So if you're talking about a particular video like introduction to classes, and it's like four minutes and 15 seconds in. Just let me know that it's in the classes video and it's four minutes and 15 seconds in. That helps me jump to that video, and I could see exactly what you're talking about. I have over 1500 videos made, I think now in my teaching career, and so it's it's actually really hard for me to keep track of all of these. So if you could just sort of help me out with that, that will help me provide a good answer to you in a timely manner, which is what I aim to do. I want to help you learn python effectively and efficiently. And this is going to help me do that. Thank you so much. And I look forward to helping you learn python. 13. Taking Notes Beside Code: through this course, you're going to see me taking some notes and I'll leave like little titles and stuff in here and in the final notebooks. You're going to see a lot more organized code, and you can do the same thing that I dio. So when you were in a cell like this, all you have to do is come up here and switch it from code to mark down or even a heading. And in this case, Jupiter, saying Jupiter no longer uses special heading cells and said, You use marked down now, if you're familiar with, get at all or get Hub read me. Files are marked down files and in a markdown file, you can have headers. We can have smaller headers, and you can actually see that this is getting smaller every time I add or remove one of these, and so markdown is very commonplace. And if you want to take really nice notes, you can Google mark down. It is a very simple language, so one number sign when your cell is marked as mark down will be a large title, and then you can make a new line in here. And if you want to write some of your own code, but it should display his code and not actually activate. As Python, you can use three back ticks and then three back takes at the end. And in here you could say print some code and var is equal to I don't know, python. And then all you have to do is execute this cell. So if you run this cell Mrs now formatted like code, you could always double click in there as well. And if you want to, you could put some warm ipsum in here. And let's say you're talking about some code you can do in line code and you just use one back tick and another back. Take there and let's do one here and one here and this once we run this out, Well, actually, look like it has code formatting. And so in here we could write some python script like print. Welcome to Python for everybody. And we can have this code actually execute. Now. This cell is a code cell and below it we could have some notes if we wanted to. Now, if you see any of my code and you want to write some of your own notes. You can always just click on the cell and go to sell. Uh, not so actually meant insert. You can go to insert cell above or below, so let's go ahead and add a cell below. And let's change that style to a markdown. And in here we can write a note. This is how we write a print statement in Python. And then we could say I e print hello, and that actually didn't break onto two lines because mark down doesn't care for a single line, so you have to write two lines. But it seems you execute that sell. It will put it on a new line for you, just like that. Last but not least, you can also add links as well as pull quotes, so print this is going to be a link see below. So that's some code. And let's go ahead and change this one too mark down. And we could say python for everybody dot com, Or let's just really prove that this is going to be, ah, proper link dot Come. So that's hard brackets that's going to be your text. And then in soft brackets in parentheses. You could put http s python for everybody dot com, and as soon as you run that sell, this becomes a link. I can actually click it, open it in a new tab, and it has my text in there. So that's a link we can also do. Pull quotes, pull quotes and let's go ahead and change is back down to Marc down. And a pull quote starts with a greater than symbol in marked um, not in Python, but in Marked Down I can put some Laura Ipsum text in there. Just 50 words of Lauren Ipsum hit Enter and this looks like a pull quote. It's got a nice little border there. So as you progress through this course and you were looking through the interactive notebooks, don't forget that you can always go ahead. You can insert your own cells. You can delete the cells that I have. You can modify it and really make it your own. You can add all sorts of notes as well, and they don't have to be formatted nicely. They could be in whatever format you like, and that is how we take notes beside interactive python 14. Basic Arithmetic: alrighty. Let's take a look at some basic arithmetic now when I say basic arithmetic all I mean here is math and I don't mean advanced math. It's not algebra, it's not calculus. It's nothing complicated, but we do need to know how we can add, subtract, divide, multiply and will probably even use exponents. Oops and give you a sneak peek there exponents. So in python and in most programming languages, these rules hold true. So when you're trying to add a number, you can add, let's say, 89 plus 11. And that's just simply going to add the number that will give us 100. And likewise, if we wanted to subtract a number, it's the subtract symbol. It's a 100 minus 49 is equal to 51. Dividing is a simple as 100 then you use a slash divided by. Let's divide that by 10 that will give us 10 and if we want to multiply, we could do nine times nine, and to multiply. It's just an asterisk. So it's the little star symbol, and that's how we multiply and exponents air one we're going to be using throughout this course quite frequently and in exponents. In some programming, languages is like three to the power of three. But in python we use two asterisks side by side. So three to the power of three is going to give us 27 3 times, three times 33 times, three times three is what that is. And that is how we do an exponents. And there's one other thing that we're going to look at a little bit down the road, and it's called module. ISS module is, and you know, when you divide a number and you get a remainder, that's what a module is is. So if you divide in 10 by three, you're going to get three with some remainder. So 3.333 now what if you wanted to get that? Remainder is a number, so three goes into 10 3 times 369 and there's a remainder of one. We can do that with the percent symbol. So we take one number and we divided by r No, no, not divided by we module iss it by a second number and hit enter and we get one. So what that means is three goes into 10 3 times 369 and then 10 minus nine is going to be one, and that's your remainder. Beyond that, we're actually not going to be doing too much arithmetic in this course. And, believe it or not, there's actually not a lot of mathematics in most programming these days. There is mathematics if you get into data science or if you want to get into. Even some forms of machine learning has some math, but for the most part, programming does not have a lot of math. And so, by no means do you need to be a mathematician in order to learn how to program. People always think that, Oh, because you're a programmer, you must be good at math, but that's simply does not have to be true. So that is basic arithmetic, we add with a plus symbol, we subtract with the dash or the minus symbol. We divide with a slash. We multiply with an asterisk or the star we exponents with two stars, and this is just multiplying three numbers together and we module IHS or get the remainder with a percent symbol 15. Variables: Okay, Dokey. Now we can actually start getting into learning python properly. So a little while ago, what we did Ah, we had this thing called a print statement or a print function and we said, Hello, world hit shift Enter And it says Hello world. And that is essentially all it takes to run a python program. But there are these things called variables and what I'm going to do. Just delete that and a variable is really just a way to assign some sort of name to have some sort of value. So let's not do name, Let's do course. That's a variable name is equal to, and we see just one equal sign. Maybe I can make that a bit bigger. Here course is equal to, and then we have different variable types, data types, but we're going to keep this symbol. For now. Let's use a quotation with an opening and closing quotation mark There not course. Let's do python for everybody. Hit, shift, enter and it looks like nothing happened. But if we type course and the new shift enter, our interactive shell here will tell us that it is a value of python for everybody. And now what you can do is print your course name Python for everybody. Now, the difference here is print will actually print this out. Whereas just because we're in an interactive shell here, this is sort of displaying it for us in terms of which one you should use currently, When you're using Jupiter Notebook, you can use either one. It doesn't really matter, but any python program. When you're actually creating a dot pie file, you'll want to use the print statement because that will actually display tax in your terminal or in your command line program. So what I would like you to dio is create a new Jupiter notebook or open up your python shell on your command line, type in courses equal to python for everybody and then type in course and then print course . And that's it. At that point in time, you have already assigned a variable. Now the nice thing about a variable is you can reassign it so we can say initially, courses Eagle do python for everybody. But we could also say if we wanted to change that value, we could say the course is now going to you for some reason, transform into JavaScript for everybody. And if I hit course, enter print course shift enter. You can actually see if I scroll up here. Course was originally Python for everybody. We printed it. We know that that's exactly what it is. And then we changed it to JavaScript for everybody printed that, and we now know that course is now JavaScript for everybody. So any time we access it down the road, it's always going to be JavaScript for everybody. So we set the value python for everybody, and then we overrode it. Now that's basically how variables work. It's just a name that points to something, and that's actually the key behind a variable. What a lot of courses won't tell you is how a variable works behind the scenes, So a variable is just a name. Python behind the scenes does not care what this is called. It could be called literally anything. There are some rules it should not start with a number, for instance, should not start with special characters. Just give it a normal name with just regular letters and maybe underscores. And if you want uppercase letters, some something like that as long as it's just a regular text name. Python doesn't care what it's called. Then we use an equal sign. And what this says is, Hey, Python, please give me a little piece of memory from the computer. So a little piece of that ram that's going on or some processing power, However, memory is allocated on the particular computer. I just need, let's say, 128 bytes of memory, and wherever that is, I don't really care where it is. Just give me 100 28 bytes of memory and then I'm just going to use a code name, course toe access, those 128 bytes of memory. Now, this point in time, that 128 bytes of memory inside of it, says Python for everybody. And so really, what we're doing is we're taking this text and we're jamming it into some sort of memory inside of your computer. And so when the script runs, Python says, Okay, there's a name called course I know that's a sort of a code name for this piece of memory that I don't know way over here, and the user never needs to know about it. But I know that it has a code name, of course. And inside of it it says python for everybody. So whenever the user types course I know that it's supposed to be python for everybody. So really, all it is is Ah, you've got let's say a code name a k a variable name is equal to And this will actually assign a piece of memory to this variable for you and then anything you want in here And I'm actually not do that cause I don't need that. But then let's say down the road, I overrate that variable, which we did now pythons going to say Okay, well, this has the same variable name. It's already allocated to Python for everybody. But what I do about it, I mean, it already has some data here. So what do I do? And behind the scenes Python is going to say this already exists. You know what? Throw it out, Delete it, get rid of it, get out of here. And I'm going to create a new variable with code name, of course. So it's just going to be the exact same code name, but is going to point to a different memory location. That's how a variable works behind the scenes. No, that's a little important to understand down the road. You don't need to know about it too much right now, but just tuck that in your back pocket because we're going to reference us a little bit later. In this course for now, setting a variable is super easy. You say the variable name is equal to, and then whatever the value is going to be, make sure you have quotations in there because that is a particular data type that allows you to use spaces and characters like P Y T H o n. So go ahead, give this a shot creative variable, and then prints that variable out. Once you have done that, I think we are ready to move on to the next lesson. 16. Formatting in Python: formatting and python is very different from other programming languages. In languages like PHP, we have this opening syntax and every variable starts with a dollar sign so it will say hello is equal to how low And then we've got Semi Coghlan's and then we can print Hello. Actually, we don't print we echo Hello and that is and so this is PHP syntax formatting. We don't do any of that in Python. In JavaScript, we use a lot of curly braces as well. So in javascript you'll see something like function name Curly Brace and doesn't stuff, and you'll see a lot of curly braces in JavaScript. You will not see them very often in Python Python instead has opted in for a cleaner style of coding, and it looks a little weird at first. But once you get used to it, it is a beautiful thing, and it makes your code really easy to read right away. So python largely works on indentation, so we're going to look at a few more advanced features right now. You don't need to know these, but I just want to show these as a demonstration of how formatting works in python. So in Python, every piece of code originally should start on the very left right here so we can create a new variable like course, is equal to python for everybody. And because it's right up against that side, Python will immediately evaluate that incitement. Okay, there is a variable, and inside that variable is python for everybody. Let's go ahead and space there that will drive me nuts. Now the javascript example that I wrote was like Function does a thing. Curly braces. And then, if we wanted to, we could write some stuff here. Usually you see some inventing, but it's actually not necessary. And it's not necessary in languages like PHP, either. What Python dozens done is I'm going to create a function here. But don't worry. You don't need to know this right now. We'll learn about functions down the road. But Python does this thing where it's like OK defined a function called name, and instead of a curly bracket, we use a colon, and then, instead of having a closing curly bracket, we simply in dent everything so we could put a variable in. Your welcome is equal to hello world, and as long as we have logic in here, that's always indented. Python will say all of this indented code belongs to this function. And to get out of that function, we can always just delete and go back to the left most space. So as an example, I'll get rid of this because that's going to break my code. But then I could say Print. Hi, hi, hi. Hi, I and it still works versus if I intend this. It doesn't work. Python now knows that there's a function named name again. Don't have to worry about knowing what a function is at this point in time, but it didn't print high, and that's because it wasn't hugging that left side. In other programming languages, you'll also see lines ending with a semi colon. We don't use those in Python. You can use them, but generally we just don't We don't need them. And so any time you put something on a new line, Python says, there's a new line. Okay, I understand that that's a new line, whereas in other programming languages you sometimes need to put a semi colon, and that tells the programme that there's a new line there. But Python is smart enough. It just says, Oh, there's a new line. Okay, well, do something new. So the biggest take away from this particular lesson is actually just that in denting. So we don't use curly braces like you might have seen in movies or other programming languages we always use in denting. And whenever something is indented, it means it belongs to the thing that is out dented most from it. So as an even more complex example, we could have another function in here called thing. And we could say Print high, high, high, high in here. Actually, it's a bad example is do. Hello. Hello, hello, Hello, Hello. And this print statement now belongs to this function, and this variable belongs to this function. So in denting is very important. Now there's two ways to in Dent in python, you can either use tabs or spaces. There's been this ongoing war forever. What's better tabs or spaces? But I think most people prefer to use spaces. However, we tend to just use that tab key. So if you hit Tab, you'll see that it's jumping four spaces at a time. 12341234 And last, but not least and again, this is a more advanced subject. But if you ever see some sort of inventing and there's nothing underneath it, Python will freak out about that. So you could say if something is true and again, you don't need to know what that is right away. But you could say if something is true and it needs to be indented for it to run. Whatever code is in here, if you simply just said, if true, and then over here we did print Hello. This is going to give me an error indentation error to be exact, and it's because it's expecting an indented block. It is expecting some code to living here, and if there is no code in there, you can just type pass, and that will tell Python you can still execute this, But hey, there's nothing in there, so just don't do anything. Just skip it and it works. So again, the biggest thing about formatting in Python really is indentation, trying to keep it the same. So if you're using indentation of four spaces used four spaces everywhere, don't use four spaces here and then used tabs here because python will think those are different things. So if you spaces, stick with spaces. If you use tabs, stick with tabs. And typically, if you invent with four spaces or one tab, then always use four spaces used. Four spaces here. Use it here, and then you can also use four spaces here, and that just keeps your code looking nice and symmetrical and keeps it nice and readable. So that's formatting and python. You're going to see this through the rest, of course, and it's good to know why this works and how it works. 17. Python Data Types: Hello and welcome back in this video, we're going to be talking about python data types now a data types, data structures. These sound like really scary things, but actually it's not. There's a really easy way to look at data types because really, programming is just mapped after what we have in reality. So in Python, we have different data types we've got, uh, let's say, numeric, let's go ahead and add another one in here. And this one's going to be called Boolean ins, and I'm gonna go over each of these individually. Okay, so there's four of them in here that we're going to cover. Initially, there's actually more, but these are the ones that you're going to be working with literally every single day as a python developer. So we here we have numeric numeric is really just means we have integers, we have floats and we have complex numbers. All that really means is, for example, an integer is a full number. So we've got 12345 There are no decimal points. It's just a full number. That's an integer. Then we have these things called floats, and a float is a number with a decimal, so that could be 1.0 3.14 100 point five. It could be any number that has a decimal in its even if that decimal is totally redundant in real life is called a float. Because even if that number is something crazy like this, you can sort of think of that decimal as being able to float around between the different numbers. We could put it there. We could put it over here. We could do that. But over here, if we wanted to, So the decimal consort of bounce around it can float between the numbers. And then lastly, we have these things called complex numbers, complex numbers and complex numbers. Actually, we're not going to get into this because I'm going to be pretty rare that you get into this unless you get into data science. But for now, we can actually sort of somewhat avoid complex numbers. But complex numbers are, for example, in real life, if you had 10 to the power of 15 or in my case, because I didn't type 15 10 to the power of 45 so in computer and sort of look something like that and programming It looks like that. So we've got this strange, complex number that could be really, really big. It could be sort of fractional if you want it to be. Anyways, complex numbers were not going to get into those, but that is a numeric type. Boolean is on the other hand, Boolean Zehr Easy billions are either true or false literally. That is it. And you can actually see that all three of these are keywords in python. So true with a capital T false with a capital F, and the word or is used in statements will talk about those down the road. But really a Boolean is Hey, are you watching this video right now? Yes, you are. So it's true. And if I asked you hair you currently watching this video from a different planet? Well, no, you're watching this on Earth right now, so that's going to be false. And that's all the Boolean is and a lot of programming logic, really just come comes down to Boolean says something true or false. Now billions have this darker, deeper side to them where things can be turned into billions. We could turn test into a Boolean like this. We'll talk more about typecasting a little bit later and let's go ahead and run that. And it says true eso. There's a little bit more to billions and just true or false. But really, it boils down to Is something true? Or is something false? That's all it is. And when we talk about computers and the word binary, that's what we're talking about. True or false, it can only be one or two different things. A sequence is like a list. It is something that you can loop through, so it's a lot like your grocery list. So let's say you go to the store and on your grocery list you need You need a few different things. Let's say you need milk, you need eggs and you need bread. Well, this is your grocery list, and so you go into the grocery store and you say, OK, my first stop is going to be milk item number one. Then we're going. Teoh, look for eggs. That's item number two, and then I'm going to look for bread. That's item number three. That's really all of sequences is a list of things like that. Now in the world of Python, we actually have a data type called a list, and that's exactly what it is. It is literally a list of things like milk, bread, eggs, something like that. And that's actually a list. We also have these things called topples or some people calm pupils, and it looks almost the exact same. But we have parentheses around him. We'll get into all these down the road as well. I just want to get you sort of familiar with how some of these look. And lastly, we have these things called sets, and a set is again looks very, very similar, but has curly braces around it instead of parentheses or a hard bracket. Now there is a difference. A list can be added to can be modified. A couple cannot. So this is like saying you went to the grocery store and you were only allowed to buy three things. You have to get milk, bread and eggs. You're not allowed to get anything else. No chocolate bars, no chips, no orange juice. Nothing. You can only get these three things, and a set is a lot like a list, but technically, a list can have the same item over and over and over again. So while this lesson this list would be, Hey, Caleb, can you go to the grocery store to get milk, bread, eggs, eggs and eggs? That doesn't make sense. Instead, a set says, OK, well, eggs appears three times. It's the same every time. So let's just make a show of once. It's unique. That's what a set does, and we'll dive in. The sequence is a little bit later as well. Dictionaries, on the other hand, are very different. Very, very useful, very, very powerful. A dictionary sometimes just called D I. C t a dict with a T at the end there. It also starts with an opening and closing curly brace. But this one has a thing called a key value pair, and so the key is the name you're going to give it. So let's say I had to go to the store for a particular type of milk, and for whatever reason, I needed to get goat's milk. And then let's say I was also needed to get eggs, but I needed to get free range eggs and so now we can actually use this as a variable that holds other variables or data types that can hold other data type. Now we can actually mix and match a lot of these. And before I actually continue, I missed one sequence in your one really strange sequence. This one doesn't look like a list at all. This one is called a string. We've actually worked with this already. Python for every buddy we've seen this before, where the variable name is equal to, and then we have quotation marks around it. And technically, this is a sequence to because behind the scenes, Python says, Okay, there's a P. There's why t h o and space F o r space E v E R Y b o D y. And every one of those letters gets set aside in Python. And so, technically, this is a list as well. It's just a list that's sort of compact and looks like it's not a list. So this is the odd one here, anyways, for the most part, we can mix and match a lot of these. So instead of a list being a string of milk, bread, eggs, eggs and eggs, We could also say there could be a true in there. There could be a false in there. There could be a dictionary in there. That's just an empty dictionary. We could say that there's an empty topple in there, and if we wanted to, we could even say that there is another listing your so a the see and let's just close off that list. And so we have all these different data types inside of a list. We can do that with topples. We can do that with sets as well a string. Although it's a sequence technically can't really do that if we put the word true in here. Well, we know true is a Boolean, but because it has the quotations around it, Python says, This is a string, and so it acts a little bit different. Although we can technically go through each one of these and say, Oh, there is a b o D Y space T R U E as well, so little different. We'll talk about that down the road because that's, ah, a strange one to deal with. But it's also really, really useful, and the same thing with the dictionary as well. So let's go ahead and create a new dictionary. It will call. This person is equal to. And then let's give this person a name. The name is going to be Caleb. That's just going to be me. How many cats do I have? I have to, and if we scroll up here, we can see to is a whole number. So it's an integer. And let's look at family members, family members, and this one's going to be A list of family members. Actually is going to be a temple of family members because it's currently this can't change that. I know it could technically change eso. Let's say we have mother, father, brother, sister. And so now this person has a name, cats and family members, which also includes a list of mother, father, brother and sister. Now, that's all really cool. You probably don't know how to apply that right now, and guess what. You don't need to know. We're going to go through each one of these one by one with proper examples and is going to make a lot more sense as we progress through this course together. So the last note on this last but not least is Please do not feel the pressure to have to memorize. All of these thes will come to you over time. These will become second nature to you over time. So don't feel like you need to sit down and study this for an hour. Anything. We're going to work through proper examples together, and it will become a lot easier to understand as we actually create real life examples. 18. Mutable Vs Immutable: all right, before we get started with actually playing around data types and getting to know them and work with them and how they work and getting some hands on practice. Let's actually take just a quick minute or two to talk about mutable versus immutable. So an immutable thing is a value that basically can never change. And a mutable thing is a value that can change, you know. Basically, in the world of programming developers and programmers such as myself, we like to use bigger, fancier words than what we actually need. So things like mutable and immutable really just means changeable and not changeable. That's all it means. So one thing to note here is, sometimes we actually don't want a variable value to ever change. We want to set it and basically have it set for ever. And there's 12 reasons that we actually want that the first reason sometimes is performance . And if we say that there's a variable that can't change for any reason, Python behind the scenes says Okay, well, I can't change it, so I'm not going to. I'm not gonna add anything extra to it. It's just here's your data do whatever you want with it, which isn't much. And so it doesn't have to keep in the back of its mind or in its memory that it can be turned into upper case or lower case or transformed or sliced or anything like that. And the other reason is data integrity. Sometimes you want a particular value to never change. For instance, if I was to say My name is Caleb, well, that's never gonna change for the rest of my life. So I don't want that to ever change. Or if my age is 30 I don't want that to change ever. I want to be 30 forever. So let's take a look at some immutable versus immutable examples. So immutable example would be like a list. So let's say we've got a food list and we sort of dove into this a little bit in the last video on. We'll talk more about lists and strings in these data types, formerly in just a little bit. But let's say we've got a list of food here, and so I've got eggs, milk and bread. Well, lists are immutable. So what I can do now is if I run that cell I can do food hit dot and then if I hit Tab, you can actually see that. I can append to it. I can clear it, copy it, counted, extended. I can do all sorts of stuff, so just keep this in mind. And so what I can do here is I can append to this and say, Hey, I actually don't need eggs, milk and bread. I need eggs, milk, bread and chocolate because I'm an adult and that's what I'm going to eat for breakfast. And if I take out food and run this cell, it now says eggs, milk, bread and chocolate. And in fact, what we can do here is that just print this out and rerun all these cells. So originally, food was eggs, milk and bread. And that's what Python says it is. Eggs, milk and bread. And then we said, we can add to it. It's mutable. The list that can change. So we added chocolate to it. Eggs, milk, bread and chocolate. Now let's say we have a list that we never want to change. Let's say we get sent to the store by Grandma because she gives us $10 we can only buy things for baking cookies with her. So basically, we need to buy one big bag of flour. So let's say Grandma's list is going to be a couple because they topple is not changeable, its immutable. And she sends us for flour and, um, maybe butter, cause that's what we need. So we've got this list of flour and butter, and if we print this out grammas list to against his flour and butter. But unlike the original list, if I hit dot and then hit tab, I only have two options here. I can count it. Oregon Index. That's it. We'll talk more about what? These are a little bit later, but I only have these two options. Whereas food, if I come back up here, had dot hit tab, I have all these different options. Now that's where performance increase comes in. This list cannot be changed. Its a couple. It's a list that can never be changed. This one can be changed. And because of that, Python says, Oh, you you want tohave? Ah, changeable list. I'm going to give you all these different options and down here it says Oh, you want to have a list? I can never change. I'm not going to give you those