Python Crash Course #1 - Intro & Setup

Net Ninja · Beginner ·🛠️ AI Tools & Apps ·2y ago

Key Takeaways

This video covers the basics of setting up Python and a code editor, specifically Visual Studio Code, and provides an introduction to writing and running Python code.

Full Transcript

hello there in this tutorial series you are going to learn everything about the Python programming language and just to get started I will cover two major parts number one white choose python in the first place number two is going to be about how to get started first of all though why choose python in the first place and for that you have to be aware that there are hundreds of programming languages and usually a language is made for a specific purpose or for example JavaScript was initially developed to make websites interactive and super shiny although ever since then it basically expanded to do pretty much everything python on the other hand was originally developed to teach people coding back then it wasn't even meant to be an actual programming language but over time it grew very fast and was steadily expanded and eventually it became a real programming language that was actually surprisingly popular today actually python is arguably the most popular programming language with that we are getting a couple of advantages most importantly because of its history python is incredibly easy to learn and to use it is incredibly streamlined very forgiving and makes it super easy to find mistakes on top of that there is a huge Community around python which is amazing if you have a question or want a tutorial because somebody probably already asked a question or made a tutorial on it also because of this huge Community there are lots of expansions to python that all make the language even more useful finally python is primarily used for data analysis artificial intelligence and servers or data stuff in general jobs that are very much in demand and generally well paid however you have to be aware that there are some disadvantages when it comes to python the most noticeable one is that python is comparatively slow it sacrifices speed to be more flexible and easy to use which in most cases is not going to matter for your specific purpose which for most cases isn't really going to make a difference and lots of modules in Python are actually getting around this limitation where you notice this limitation the most is in game development now you can make games in Python but it's not really a professional thing most of the time it's either a hobby or a way to learn programming if you want to learn actual game development you would want to use a game engine like gdau unreal or Unity besides that python isn't really used for apps or user interfaces once again you could be using it for that purpose but there are better tools available you would rather use react or something like flutter which are giving you significantly more and better tools finally python is giving you less control over the hardware now this in most cases is a kind of control you don't really care about for example in other Lang languages you could control the memory management of your computer and if you don't know what that means don't worry too much about it you are probably not going to use it in the first place the general philosophy of python is to abstract all of these problems away so you can focus on the actual logic of what you are trying to achieve with that you might have the question if you are just starting what programming language should you start with and for that question python is usually a good answer mostly because it is incredibly easy to learn what you can do if you don't end up liking python or want to do something else it is very easy to switch to another programming language and then retain most of the knowledge programming languages share a lot of ideas meaning if you know python it becomes significantly easier to learn something like C++ or JavaScript or literally any other programming language all right now with all of that we have to talk about how to use Python and there are two steps to that number one we you have to install python itself it's just going to be another file on your computer after that we are going to need a code editor I am going to use Visual Studio code or vs code in short which is I think the most popular code editor although there are quite a few Alternatives Sublime py charm and atom are really popular ones as well and there are loads more if you already know some coding and you have a code editor that you really like to use you can totally keep on using that one all right so let's get started on how to install python for that you want to go to Google and type something like python download or simply python should also be good enough then the first result should be the official python website click on that and then you can see a python download button at the moment the most recent version of python is python 3.12 which is what I'm going to use for this tutorial if you click on that it downloads sh start once this one is done you can go to your downloads folder double click on the python symbol and then you should get the install dialogue before you click on install now there's one really important thing you have to do and that is to add python.exe to path if you are on Windows on Mac OS this is happening automatically but on Windows you have to make sure that you are adding python to the path that way a code editor could find the program and use it to run python if if you're not ticking this box you're going to have lots of Errors so make sure to tick it and then click on install now you can also customize the installation but you don't really need to then you have to wait a few seconds and after that you should have python installed next up we have to get a code editor and in my case I want to use Visual Studio code or VSS code ins shorted for that go back to your search engine of choice and type in vs code download the first result should be what you need and on that website you can choose your operat in system in my case I am working on Windows but obviously if you are on Mac OS click on the Mac download button click on the icon and then you can install it like any other program I would recommend to keep all the default options but do make sure that you have the add to path ticked that one does matter after all of that is done you can click on launch Visual Studio code which is what I want to do once you have done that you should be seeing something like this now the main window you you don't really have to worry about too much what is rather important is on the left side there you have a couple of icons that are much more important for example at the top we have the Explorer and in there you can see all of your open folders and files as a matter of fact while we are here I want to open a folder which I'm going to use for all of my files meaning I want to open a folder and then you should be seeing something like this basically what you want to do is to create a folder with all of your code in my case I already have a path that I want to work in so let me paste it in and there I want to select a code folder which at the moment is entirely empty with the folder selected I want to click on select folder and then nothing has really changed although now if we are clicking on the Explorer again we can see code and we can see that there's nothing inside of the folder to fix that I want to right click and then create a new file this this file now needs a name let's call it setup we will need pi as a file ending so our computer knows that we have a python file if we are doing that you also get the python icon a little snake on the left side of it and if I now press enter we can write some code also we still have the welcome tab this one you can just close also if you look at the bottom right there you can see we have Python and if you click on python you could select another language but this is not what I want to do instead I want to write some incredibly simple python logic and for that I want to write the word print then use parentheses then quotation marks and in quotation marks the word test or whatever word you want to print make sure you're spelling this in the exact same way for all programming languages you have to make sure that you don't have typos and parentheses and quotation marks are really important all right with that we have one line of python code but now we have to figure out how to run all of this and this we can't really do right now for that you want to look on the left side there we have extensions this you want to click on and then you already get the recommendation that you should install a python extension for vs code if you cannot see this one simply type in the search bar Python and it should be the first result this this is what we want to install it's going to take a few seconds and then we have python installed if you now go back to setup.py in the top right you can see a run python file symbol if you click on that you get a terminal and in there we have test this is the word we have just written inside of the print statement and that is all that print does it simply prints out a word and with that we have some basic python set up now you can customize vs code quite a bit for example what is really popular is I think this is called material icon this is a purely visual extension at the moment if you are looking at the Explorer the python symbol looks a bit boring and for that if you're installing material icon or any other theme let me install material icon and then you have to select an icon theme setti is the default one but I want to use material IC theme so click on that and now if you go back to the Explorer the python symbol looks significantly better and that's all that's happening in here there are loads more extensions you could be using but to get started you don't really need any more also you can close the tab with the extension and the new welcome tab we will not be needing any of those however what you might want to do is to customize a few more minor things like the font size for example if you're watching all of this on a smartphone the text is going to be really small for that you want to go to file then to preferences and in there we have settings if you click on that you can customize basically anything inside of VSS code for example there we have the font size you can set this one for example to 20 and if you know press contrl s to save go back to setup you have much larger text you can also use search settings and type in something like terminal font size usually vs code is very good with the search function there we have integrated font size for the terminal let's change this one to maybe 20 and now we have much larger text could even be a bit larger let's say something like 24 that looks about right simply choose the number that you like it's entirely up to you these numbers are fairly subjective and also depend on your device simply play around with them and see what feels right now besides that what you can also do if you go back to file preferences and there we have keyboard shortcuts those can be quite nice for example what I might want to do instead of always clicking on the execute or run python file I want to bind this to a shortcut and for that you go to keyboard shortcuts and then use the search function I want to use a shortcut for run python file and there we have the command and if you double click on key binding you can set a shortcut in my case I'm going to use alt and a which is a shortcut that isn't used by vs code and also very easy to use on your keyboard if you now press enter you can go back to setup. Pi and instead of clicking on the symbol you can let me close this actually you can simply press alt and a and you get the same result makes the entire thing much faster to work with nearly done the last thing that I want to cover is a full screen mode and the shortcut for that is a bit weird if you go to view there you have appearance and you can go to full screen or Zen mode and the shortcut for Zen mode is contrl k then you release the keys and then the Z key or you can simply click on it same result but if you want to get out of it you press contrl K and then you release control and then press Z that way you go back the keyboard shortcut does get a bit of time to get used to but once you do it's actually quite nice and I am going to write most of my code in something like this that way it's going to be quite a bit easier to focus on one thing at a time but other than that we can still run the code via the symbol or we can press control a you're getting the same outcome also what you can do if you go back to file and preferences under settings you can customize the Zen mode quite a bit as well for example in my case I don't really like the center layout if I now go back to setup.py and go back to Zen mode we have the code all the way on the left and in settings you could also hide the tabs those are the icons at the top to switch between files since I am mostly going to work with a single file I'm going to set this to none that way if I now go to setup and go back into zen mode we only have the one python file and that I think at least to get started is a really good setup but once again simply choose what you like the most there's no Universal answer for any of this but anyway with all of that we have a setup of python so next up we can work on writing some actual python logic I'll see you there

Original Description

In this Python crash course tutorial series, you'll learn all the basics of Python from the ground up. 🚀🥷🏼Get access to the Python Crash Course on Net Ninja Pro: https://netninja.dev/p/python-crash-course 🔥🥷🏼 Access Premium Courses with a Net Ninja Pro subscription: https://netninja.dev/p/net-ninja-pro/ 🔗🥷🏼 Check out Clear Code for more of his own tutorials: https://www.youtube.com/c/ClearCode 🔗🥷🏼 VS Code - https://code.visualstudio.com/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Net Ninja · Net Ninja · 0 of 60

← Previous Next →
1 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

This video teaches the basics of setting up Python and a code editor, and provides an introduction to writing and running Python code. It covers the installation of Python, setting up a code editor, and writing basic Python code.

Key Takeaways
  1. Install Python from the official Python website
  2. Add Python.exe to path during installation
  3. Download and install a code editor such as Visual Studio Code
  4. Create a new folder for code and select it in the Explorer
  5. Create a new Python file with a .py extension
  6. Write a simple Python print statement
  7. Install the Python extension in VS Code
  8. Run the Python file using the 'Run Python File' symbol
💡 Python is a popular and easy-to-learn programming language that is widely used in data analysis, artificial intelligence, and servers.

Related Reads

📰
AI Tool Scorecard: 5 Dimensions EU SMEs Miss Before Signing
Learn the 5 key dimensions EU SMEs often overlook when evaluating AI tools before signing a contract, and how to create a scorecard to make informed decisions
Dev.to AI
📰
Aplikasi AI Harian Untuk Produktivitas, Bye Burnout!
Boost productivity with daily AI applications and say goodbye to burnout by leveraging tools like ChatGPT, Notion AI, and Canva AI
Medium · AI
📰
From stethoscopes to source code:Why I Switched from Pre Med to BS AI
Learn how to transition from a pre-med background to a career in AI, and why making this switch can be a great opportunity for growth and development
Medium · Programming
📰
Ilios Software Pvt. Ltd.: Building Practical AI Products That Solve Real Problems
Learn how Ilios Software Pvt. Ltd. builds practical AI products that solve real problems, and why this matters for businesses today
Medium · AI
Up next
How I use OpenAI to structure ad data and show my team what matters
Josiah Roche — Google Ads + SEO Training
Watch →