Object Oriented Programming with Python - Full Course for Beginners

freeCodeCamp.org · 2.4M views · 2021 · 2:12:35

Open on YouTube

Python, Ruby & scripting languagesEducation & learningcourse

Why Stack Overflow recommends it

Stack Overflow users link it because askers say they are following it when their code breaks, and answerers cite its timestamps to explain the same confusion.

Recommended by 2 people across 2 different months, 2022 to 2024.

What it is

A 2h12m freeCodeCamp course by Jim of JimShapedCoding that teaches object oriented programming in Python for beginners. It covers classes, __init__, class and static methods, inheritance, getters and setters, and general OOP principles, building an Item class example.

What people said

Recommends Nagaajay k · 2023-02 · Stack Overflow · on “Why does the num.is_integer() function returns false”

Just needs to remember that functions with same name and different parameter's are different In our case is_integer(num): user-defined function #which is defined by us is_integer(): inbuilt function #which is used inside the function I am also following same tutorial in freecodecamp youtube channel, Object oriented programming using python [this video] At 1:09:00 timestamp i faced similar confusion so i ran it is separately and understood it, we are not removing any .0 from num and we are using recursion. the .is_integer() function used inside without parameter is inbuilt function enter link description here [LINK] so that inbuilt function generally removes .0 presence and return true for integer

Recommends Clock · 2024-02 · Stack Overflow · on “__repr__ in the child class doesn't show all it arguments, is that a normal practice?”

I try to learn OOP from this video [this video] at 1:30:00 is what related to my question, but in this code snippet, I will delete anything that is unrelate to the question, and the code snippet alone should provide enough context. My parent class has name, price and quantity as the arguments. My child class has a unique argument call "broken_phone". The problem is centering around repr This is the code that was shown in the video(exclude unrelated stuff) class Item: all = [] def __init__(self, name:str , price: float , quantity:int): #Assign to self object self.name = name self.price = price self.quantity = quantity #action to execute Item.all.append(self) def __repr__(self): return f'{self.__cl

Cites Thingamabobs · 2022-02 · Stack Overflow · on “tkinter how to change attribute value of object using OOP?”

Tkinter is based on different progamming language, named tcl and thats why things seem a bit unpythonic here. The tk.Frame object isnt a pure python object, rather its an wrapped object in a tcl interpreter and thats why you cant address the attributes you intuitivly think you can. You need to adress the attributes in a way the tcl interpreter is abel to handle and therefor methods are created like widget.configure . To achive what you want with your current code, it would look like: import tkinter as tk root = tk.Tk() class MyFrame(): def __init__(self, bg_color): self.window = tk.Frame(width=500,height=500,bg=bg_color) frame_obj = MyFrame('blue') frame_obj.window.pack(fill=tk.BOTH) frame_o

Cites Spike1801 · 2023-10 · Stack Overflow · on “How do i fix this "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'" Error?”

I am currently following this tutorial about Object Oriented Programming but even though i followed all the steps i can't seem to find a solutions as to why my code gets this error and i have no clue what this error means, here's the vid to compare if needed: text [this video] I keep getting this error [LINK] here's my code: import csv class Item: pay_rate = 0.8 #the pay rate after 20% discount all = [] def __init__(self, name: str, price: float, quantity = 0): #Run validations to the received arguments assert price >= 0, f"Price {price} is not greater than or equal to zero!" assert quantity >= 0, f"Quantity {quantity} is not greater than or equal to zero" #assign to self object self.name = name