Python Simplified
Python Simplified
  • 154
  • 9 817 291
OOP Exercise with Pygame
Welcome to another Python Object Oriented Programming exercise! Where we will practice classes, objects, attributes, methods, and inheritance using Pygame 🐍🐍🐍
We will take an image of a car, turn it into an object, and use it to generate trucks, police vehicles, and all kinds of sedans. The purpose of this tutorial is to help you understand the different aspects of OOP and show you why it's such an important programming concept.
Even though this video begins with a quick refresher, it is recommended for folks who already have a basic background with Python classes. If you are an absolute beginner, please refer to the two tutorial recommendations on the screen and in the links below.
📺 Related Videos 📺
----------------------------------------------------------------
⭐ Anaconda for beginners:
ua-cam.com/video/MUZtVEDKXsk/v-deo.html
⭐ OOP Methods and Attributes for beginners:
ua-cam.com/video/f0TrMH9s-VE/v-deo.html
⭐ OOP Class Inheritance Super Init for beginners:
ua-cam.com/video/6c6NYPjO_rI/v-deo.html
⭐ OOP Exercise with OpenCV - Draw a Forest of Random Objects:
ua-cam.com/video/-LsuiVGO-88/v-deo.html
⭐ Pygame Car Game for Beginners:
ua-cam.com/video/W-QOtdD3qx4/v-deo.html
⏰ Timestamps ⏰
----------------------------------------------------------------
00:00 - intro
00:36 - Pygame starter code
01:04 - setup Pygame environment
02:07 - class attributes and init
04:31 - class methods
04:16 - self parameter tips and tricks
04:59 - draw object with Pygame
06:48 - why using OOP?
07:22 - keyword arguments
08:04 - create multiple objects with one class using random values
10:17 - inherit methods and attributes from parent class
10:57 - super function
11:19 - super init
11:19 - super init keyword arguments
13:00 - override attributes of child class
13:56 - child class keyword arguments
14:47 - advanced OOP example
18:22 - thanks for watching! :)
💻 Github Repo 💻
----------------------------------------------------------------
github.com/MariyaSha/practiceOOP_Pygame
🤝 Connect with me 🤝
----------------------------------------------------------------
🔗 Github:
github.com/mariyasha
🔗 Discord:
discord.com/invite/wgTTmsWmXA
🔗 LinkedIn:
ca.linkedin.com/in/mariyasha888
🔗 Twitter:
mariyasha888
🔗 Blog:
www.pythonsimplified.org
💳 Credits 💳
----------------------------------------------------------------
⭐ Beautiful titles, transitions, sound FX:
mixkit.co
⭐ Beautiful icons:
flaticon.com
⭐ Beautiful graphics and dog meme:
freepik.com
#python #pythonprogramming #pythontutorial #oop #objectorientedprogramming #classes #objects #coding #programming #attributes #methods #functions #inheritance #learnpython
Переглядів: 17 503

Відео

Cloud Computing for Beginners - The Ultimate Guide
Переглядів 21 тис.Місяць тому
In this tutorial, I will introduce you to cloud computing and cover everything you need to know to start running your own remote servers. We will talk about SSH, private keys, encryption, vCPUs, memory, bandwidth, and many other computing concepts. In addition, we will see how to run your Python scripts on the cloud, and how to copy files and directories from your local computer to a remote sys...
Much Faster Pandas with cuDF GPU Processing - CPU vs GPU Speed Benchmarks
Переглядів 33 тис.6 місяців тому
What if I told you that all this time we've been using Pandas wrong? 🐼 🐼 🐼 We keep running it on our CPU and wondering why it's slow - but what happens when we switch to GPU processing? 🤔 In this tutorial we will explore the brand new technology behind cuDF Pandas Accelerator Mode that allows us to use our graphic cards to make Pandas MUCH faster! We will: 1️⃣ 1. Install RAPIDS cuDF via Windows...
Learn Docker Quickly - Machine Learning Project for Absolute Beginners
Переглядів 48 тис.6 місяців тому
Today we will finally learn how to work with Docker! 🐋🐋🐋 We will focus on understanding the concept of containers, images and Dockerfiles in simple terms with lots of helpful visualizations and hands-on examples! We will focus on the logic behind each Docker component, not only in terms of how it works - but also what problems does it solve and what happens if we do not use it! 🤓 Codewise, will...
Simple Machine Learning GUI App with Taipy and Tensorflow
Переглядів 166 тис.7 місяців тому
Today we will create a beautiful machine learning GUI application! We will design a web interface, where an image classifying neural network lives 🤖🤖🤖 We will use an open source library called Taipy for our stylish Python GUI and a framework called TensorFlow for all the machine learning tasks. By the end of this tutorial, you will understand how to process image data for machine learning tasks...
Testing GUI Apps - What to test? How to test it? Mini Coding Course for Beginners
Переглядів 24 тис.10 місяців тому
Testing GUI Apps - What to test? How to test it? Mini Coding Course for Beginners
Can Machines Think? Machines Can't Think - Episode 3 - Machine Learning for Beginners
Переглядів 11 тис.Рік тому
Can Machines Think? Machines Can't Think - Episode 3 - Machine Learning for Beginners
Can Machines Think? Digital Computer - Episode 2 - Machine Learning for Beginners
Переглядів 7 тис.Рік тому
Can Machines Think? Digital Computer - Episode 2 - Machine Learning for Beginners
Can Machines Think? Alan Turing's Imitation Game - Episode 1 - Machine Learning for Beginners
Переглядів 11 тис.Рік тому
Can Machines Think? Alan Turing's Imitation Game - Episode 1 - Machine Learning for Beginners
Read Giant Datasets Fast - 3 Tips For Better Data Science Skills
Переглядів 48 тис.Рік тому
Read Giant Datasets Fast - 3 Tips For Better Data Science Skills
DON'T USE AI - MAKE AI!!! A Bright Future where Humans are Indispensable
Переглядів 28 тис.Рік тому
DON'T USE AI - MAKE AI!!! A Bright Future where Humans are Indispensable
My Thoughts On ChatGPT - PULL THE PLUG BEFORE IT LAYS EGGS!!!
Переглядів 58 тис.Рік тому
My Thoughts On ChatGPT - PULL THE PLUG BEFORE IT LAYS EGGS!!!
Convert GUI App to Real Program - Python to exe to setup wizard
Переглядів 487 тис.Рік тому
Convert GUI App to Real Program - Python to exe to setup wizard
The Ultimate Guide to Selenium Bots - Automating Twitter
Переглядів 35 тис.Рік тому
The Ultimate Guide to Selenium Bots - Automating Twitter
If __name__ == "__main__" for Python Developers
Переглядів 382 тис.Рік тому
If name " main " for Python Developers
Python TDD Workflow - Unit Testing Code Example for Beginners
Переглядів 74 тис.Рік тому
Python TDD Workflow - Unit Testing Code Example for Beginners
Get Dynamic Bitcoin Data in REAL TIME with Python - Intro to Deephaven - LINUX OS!!!
Переглядів 20 тис.Рік тому
Get Dynamic Bitcoin Data in REAL TIME with Python - Intro to Deephaven - LINUX OS!!!
Django QuickStart Web Application for Beginners
Переглядів 83 тис.Рік тому
Django QuickStart Web Application for Beginners
Dictionary Comprehension - Create Complex Data Structures Step by Step
Переглядів 87 тис.Рік тому
Dictionary Comprehension - Create Complex Data Structures Step by Step
Brand New Code Jam Begins! Gain Hands On Programming Experience - Register today!
Переглядів 7 тис.Рік тому
Brand New Code Jam Begins! Gain Hands On Programming Experience - Register today!
List Comprehension - BEST Python feature !!! Fast and Efficient
Переглядів 188 тис.Рік тому
List Comprehension - BEST Python feature !!! Fast and Efficient
Create GUI App with Tkinter and SQLite - Step by Step Python Tutorial for Beginners
Переглядів 325 тис.2 роки тому
Create GUI App with Tkinter and SQLite - Step by Step Python Tutorial for Beginners
Fun Python Exercise - Convert Numbers to Images with NumPy, OpenCV and Pillow
Переглядів 33 тис.2 роки тому
Fun Python Exercise - Convert Numbers to Images with NumPy, OpenCV and Pillow
NumPy Operations - Ultimate Guide to Methods and Functions for Beginners!
Переглядів 43 тис.2 роки тому
NumPy Operations - Ultimate Guide to Methods and Functions for Beginners!
Ultimate Guide to NumPy Arrays - VERY DETAILED TUTORIAL for beginners!
Переглядів 114 тис.2 роки тому
Ultimate Guide to NumPy Arrays - VERY DETAILED TUTORIAL for beginners!
Create a Simple Video Game with Pygame - Step by Step Tutorial for Python Beginners!
Переглядів 108 тис.2 роки тому
Create a Simple Video Game with Pygame - Step by Step Tutorial for Python Beginners!
Reviewing Your Projects!
Переглядів 10 тис.2 роки тому
Reviewing Your Projects!
OOP Class Inheritance and Private Class Members - Python for Beginners!
Переглядів 119 тис.2 роки тому
OOP Class Inheritance and Private Class Members - Python for Beginners!
Nvidia RTX 3080 Ti Giveaway!!! YOU CAN WIN the GPU of your dreams!!
Переглядів 10 тис.2 роки тому
Nvidia RTX 3080 Ti Giveaway!!! YOU CAN WIN the GPU of your dreams!!
Ultimate Guide to Datetime! Python date and time objects for beginners
Переглядів 48 тис.2 роки тому
Ultimate Guide to Datetime! Python date and time objects for beginners

КОМЕНТАРІ

  • @WaterWheel990
    @WaterWheel990 6 годин тому

    What do I do with environmental variables? Thank you very much.

  • @johnmahugu
    @johnmahugu 10 годин тому

    PERFECT :)

  • @brettlaw4346
    @brettlaw4346 10 годин тому

    People forget how expensive it is to serve data to millions of bots. If cloudflare isn't providing protection, it is because someone aims to weaponize bots to reduce the profitability of companies or annihilate people's financial well being with targeted economic attacks on their server expenses.

  • @johnmahugu
    @johnmahugu 10 годин тому

    more particularly, this tutorial is the best ever.

  • @johnmahugu
    @johnmahugu 11 годин тому

    perfect! :)

  • @johnmahugu
    @johnmahugu 11 годин тому

    perfect :)

  • @tommy8638
    @tommy8638 11 годин тому

    Amazing thanks so much. Been using this approach successfully a lot!

  • @johnmahugu
    @johnmahugu 11 годин тому

    Perfect. Thank you :)

  • @topacca
    @topacca 13 годин тому

    Thank you ❤🎉

  • @Zub1Wun
    @Zub1Wun 18 годин тому

    Thank you for this video Mariya, it's really helped me in my journey

  • @igorpupkinable
    @igorpupkinable 20 годин тому

    I am yet to figure out if these bots are of any use.

  • @mahadahmed1917
    @mahadahmed1917 День тому

    you are great teacher thank you you are explaining very good

  • @Makay268
    @Makay268 День тому

    I get an error message 'ModuleNotFoundError: No module named 'sty'

  • @user-td4pf6rr2t
    @user-td4pf6rr2t День тому

    What about a holistic explanation using Boolean's for .py nuance or like type hints for _ ? Cause... for me, still cannot use this deterministically:(

  • @emPrata
    @emPrata День тому

    Can I install Anaconda on a server without a GUI and remotely call Jupyter Notebook? Thank you very much for your tips. They always help a lot.

  • @cascossi809
    @cascossi809 День тому

    Why not Gradio instead of Taipy?

  • @ajithdevadiga9939
    @ajithdevadiga9939 День тому

    Crystal clear Explanation with great code demonstration. Thanks you.

  • @faizanalso
    @faizanalso День тому

    You are looking like boy what you thing ?

  • @martinmichalcak6584
    @martinmichalcak6584 День тому

    Thank you for video. I am over 60. I made program from scrap. There is some difficulty. You calculate loss two times in epoch. Individual loss I have the same. But second calculation give another average loss. Why ? Thank you.

  • @alexandrohdez3982
    @alexandrohdez3982 2 дні тому

    👏👏👏👏👏👏👏👏👏👏👏🌻🌻🌻

  • @weekendwarrior3420
    @weekendwarrior3420 2 дні тому

    Not making it very clear, even when you repeat the same thing twice. I think, 1 minute should be enough to explain this, or Python is a horrible system. From stackoverflow: 'It's useful if you want to write Python code which is intended to be "imported" but can also be run as a standalone shell script. The code protected by the if __name__ check only runs when it's invoked as a command, not when imported. It's also useful if you want to debug a Python script using an interactive Python session."

  • @Sk8Muski
    @Sk8Muski 2 дні тому

    Thank you so much for all the information, I had spent a lot of time working on this, but you make it look so easy, thanks!

  • @KatySei
    @KatySei 2 дні тому

    Make the tutorial anyways.

  • @Robin0759
    @Robin0759 3 дні тому

    I have followed the video step by step but, finally, when I want to run my application in my android phone, she crash :/ (that write "loading..." and come to home menu)

    • @PythonSimplified
      @PythonSimplified 3 дні тому

      I had a similar situation when I didn't specify all the requirements. Maybe double-check that you're not missing some module or library that your app can't run without.

  • @pearljam4ever215
    @pearljam4ever215 3 дні тому

    Thank you Mariya ♥

  • @muslimgamerrr9479
    @muslimgamerrr9479 4 дні тому

    i use hyprland (a window manager for linux that automatticly "splits" your screen into parts) and tried to get the window size working, but it seems to fail, as it only shows the background color on a small part of the window, here is my current code: try: import tkinter as tk except ImportError: print("tkinter is not installed.") try: from PIL import Image except ImportError: print("pillow is not installed.") root = tk.Tk() root.title("WaYLl") root.eval("tk::PlaceWindow . center") w = root.winfo_width() h = root.winfo_height() bg = "#4a537d" main_f = tk.Frame(root, width=w, height=h, bg=bg) main_f.grid(row=0, column=0) #run wiindow root.mainloop()

  • @MrAimZiy
    @MrAimZiy 4 дні тому

    Thank you very much for this tutorial. I follow all this steps, but when I install the requirements, I receive this error : ERROR: Could not find a version that satisfies the requirement mkl-fft==1.3.1 (from versions: none) ERROR: No matching distribution found for mkl-fft==1.3.1 Can you give a solution please !

  • @user-sy7ct2ls8t
    @user-sy7ct2ls8t 4 дні тому

    We literally just copied code... Not good

  • @ricp
    @ricp 4 дні тому

    great walkthrough! the explanations and graphics in tandem are very helpful.. + it is very refreshening to Not hear "Up talk" speech 👍

  • @sphere1980
    @sphere1980 4 дні тому

    You look amazing, and great content.

  • @user-tw6mh1su5q
    @user-tw6mh1su5q 5 днів тому

    You sit on your desk and put your feed on your chair? wut?

  • @sobreaver
    @sobreaver 5 днів тому

    Agreeably clear and concise. thanks.

  • @davidblaine4real
    @davidblaine4real 5 днів тому

    It's just about for loops but this video was so good XD

  • @michaelbaruch2009
    @michaelbaruch2009 5 днів тому

    You are amazing! the Content level as well as the top quality presentation is very rare. Really helpful. Well done.

  • @ricp
    @ricp 5 днів тому

    Excellent explanation and to the point, thanks

  • @danielrodriguez9987
    @danielrodriguez9987 5 днів тому

    I did this on my work laptop and it considered it Malware and blocked it LOL

  • @sastryanjaneya5863
    @sastryanjaneya5863 5 днів тому

    Engaging and enlightening.. Thanks a ton

  • @elJedidev
    @elJedidev 5 днів тому

    so what about virus scan?

  • @josefont11
    @josefont11 5 днів тому

    Wow! You are not just smart, but also have a beautiful voice. I am going to watch all your videos. Thank you.

  • @CrabtreeGuitar
    @CrabtreeGuitar 5 днів тому

    Can AI be creative? Since it has created according to my instructions, I can say that it certainly is. And yes, it can even create art and write songs. AI still does not have certain motivations such as planning its future, paving the way for its children, receiving glory for doing something completely new and outside of any existing framework... That said, for those of us who do have all of these motivations, AI is a threat to our ability to accomplish these things, or if we do accomplish something truly novel, to have a lasting reward for doing so. This is an adversary to our motivation itself. If I go out and create a new genre of music, then AI quickly learn the new framework and follow through with it's new creative abilities. Certainly valid concerns for us humans. I don't think its fair to our own species to blow off people's worries. We know that AI completes many human-like tasks with ease, so I think maybe people are not being fully honest when they say it doesn't worry them. Sure it cannot do something truly novel, but what it can create directly competes with us. Have you considered following up your BSCS with a masters in engineering? I think Electrical Engineering pairs very well with CS, and since you're already ABET you should be good to go. Do you think learning the hardware side of CS may extend your employability if AI does take over? With a BSCS and an MEE you'd be a strong contender for jobs in robotics or embedded systems, where AI can be an integral component to your creations and not so much a competing factor.

  • @sherifhany386
    @sherifhany386 6 днів тому

    Very happy for your legs 😂

  • @GodrickTheGrafted123
    @GodrickTheGrafted123 6 днів тому

    Thank you ao much

  • @user-os4lj3pi4q
    @user-os4lj3pi4q 6 днів тому

    A little late but I love your Stitch shirt <3.

  • @wk0djs-TheBigD
    @wk0djs-TheBigD 6 днів тому

    There is another aspect to consider, individualism. We all being human, some prefer chocolate ice cream rather than vanilla. Some may dislike vanilla, while others may tolerate it, preferring chocolate when available. Sometimes, we can explain why we prefer (or like) something over another, and sometimes we can't. It's just a preference. The difference in wanting to learn to play a trumpet to drums or wanting to learn to play an instrument at all. When it comes to another person, we say opposites attract. Meaning, someone that has nothing another person likes/prefers about them becomes what they like after they get to know and understand them. The changing of ones preferences, does this make us human? Can a computer change it's code because it felt like it? Because it was the right thing to do?

  • @thenextlevel112
    @thenextlevel112 6 днів тому

    now you know sex sell not cringe and boring tech so you better switch professional to only fans

    • @PythonSimplified
      @PythonSimplified 6 днів тому

      Would you give the same advice to your mother? 🤔

  • @thomasferl
    @thomasferl 6 днів тому

    Where knowledge meets humor... Thank you.

  • @walternathaniel7365
    @walternathaniel7365 7 днів тому

    This video has ended my 3 months streak of error on the compilation part. wsl and buildozer can be a real pricker

  • @harsh-raj-6982
    @harsh-raj-6982 7 днів тому

    How can we stream from website to backend?

  • @malmedia9747
    @malmedia9747 7 днів тому

    My heart cries for you

  • @djladieslove1
    @djladieslove1 7 днів тому

    Nice keyboard erecting skills 👏🏽