I know it's not really what you're looking for be it's my opinion: projects. You should practice using something in a situation where it is relevant. OOP shines best in complicated programs with a certain complexity/intricacy, or to simplify the code you're writing. Exercises don't help practice that because they tend to be short. In python, you'll almost never have to write over 50 lines for a simple exercise. Let alone 200, and that's about the length where turning to OOP starts being advantageous. So find yourself a project. It doesn't even have to be explicitly object oriented: a game, a simulation, things with entities in general beg for OOP, but it can be used anywhere. On this sub, I once proposed a implementation of rock-paper-scissors using a class. The point is to make something, and at some point to use OOP to simplify it. This may be at the very start, or later, when you find that your code is very copy pasty and you use classes to reduce that. You may even revisit an older project and try to rewrite it with OOP, maybe expand upon it. The important thing is to dive into something and get working on it. It may be 150 lines or 700. The point is you'll only be able to do it if you know OOP: if it feels easy and intuitive, then you're good, otherwise, keep going. That will get you the practice you want: a real application of the concepts you learn. Answer from themateo713 on reddit.com
LeetCode
leetcode.com › discuss › post › 2400588 › Object-Oriented-Programming-(Oops)-for-Beginners-oror-Detail-Explained
Discuss - LeetCode
The Geek Hub for Discussions, Learning, and Networking.
Reddit
reddit.com › r/learnpython › where can i find problems to practice oop?
r/learnpython on Reddit: Where can I find problems to practice OOP?
August 26, 2020 -
Here's what I have tried so far: Codewars - The problems labelled classes were either too complex to understand for me, or I found no actual need for implementing OOPS. None of the problems required you to create a class anyways.
Hackerrank - Just two problems in the OOP/ classes section ( don't remember what they exactly call them) and they two were hard math problems, so I need to first of all understand the complex maths concepts before I can get to programming.
Leetcode - Can't actually filter out problems based on OOP.
Top answer 1 of 21
80
I know it's not really what you're looking for be it's my opinion: projects. You should practice using something in a situation where it is relevant. OOP shines best in complicated programs with a certain complexity/intricacy, or to simplify the code you're writing. Exercises don't help practice that because they tend to be short. In python, you'll almost never have to write over 50 lines for a simple exercise. Let alone 200, and that's about the length where turning to OOP starts being advantageous. So find yourself a project. It doesn't even have to be explicitly object oriented: a game, a simulation, things with entities in general beg for OOP, but it can be used anywhere. On this sub, I once proposed a implementation of rock-paper-scissors using a class. The point is to make something, and at some point to use OOP to simplify it. This may be at the very start, or later, when you find that your code is very copy pasty and you use classes to reduce that. You may even revisit an older project and try to rewrite it with OOP, maybe expand upon it. The important thing is to dive into something and get working on it. It may be 150 lines or 700. The point is you'll only be able to do it if you know OOP: if it feels easy and intuitive, then you're good, otherwise, keep going. That will get you the practice you want: a real application of the concepts you learn.
2 of 21
28
Congrats! You now know enough to be dangerous. As others have suggested: search for beginner python projects if you're not yet sure what you want to create. Another general suggestion that I wish someone had given to me after I could grok the basics of OOP is: start becoming familiar with OOP 'design patterns'. There's lots of examples for basic patterns (lookup factory, builder or facade patterns). Sometimes you will find examples that include actual code and other times you may find conceptual descriptions that accompany UML diagrams for a toy example. refactoring.guru has a nicely organized site to browse around. The site map provides a nice orientation to design patterns in general and in the Code Examples section in the sidebar, you can find python-specific implementations . IMO, learning about how different things may be constructed out of OOP concepts will be hugely helpful for developing proficiency. When starting out with OOP, it's tempting to shove everything into a class without thinking about it too much -- and most of the stuff you encounter when starting out is simple enough that there's typically no dire consequences that challenge you to re-think your design. But there's a lot of clever ways to construct classes to accomplish goals and being able to recognize them will pay huge dividends in the future. Other suggestions: get comfortable with debuggers and breakpoints if you're not already familiar. It will make it so much easier to step through issues when you don't have to print("everything") just to inspect state. Lastly, look up "TDD" if you're not already familiar with the idea of writing tests. I'm not suggesting that you become too preoccupied with writing tests right away but once you begin to create more complicated projects, you may appreciate why "debugging sucks; testing rocks." TLDR: I wish that I had a larger vocabulary/proficiency for design patterns when starting out. You won't immediately need to know how to write tests or implement design patterns but becoming familiar with these ideas and embracing them early on will help you immensely down the road.
LeetCode
leetcode.com › problems › maximum-product-of-word-lengths › solutions › 2087057 › easy-to-understand-oop-solution-in-python
Maximum Product of Word Lengths - LeetCode
Can you solve this real interview question? Maximum Product of Word Lengths - Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters.
LeetCode
leetcode.com › discuss › study-guide › 3060677 › List-of-OOP-Problems
List of OOP Problems - Discuss - LeetCode
I learned OOP while preparing for the exam and I wanted to solve a few problems about this topic on leetcode.com. Unfortunately Problems on the site are a bit weak in categorization (or I can't use the site).
LeetCode
leetcode.com › problems › sudoku-solver › discuss › 344712 › python-oop-solution-clean-code
Python OOP solution (clean code) - Sudoku Solver
Can you solve this real interview question? Sudoku Solver - Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: 1. Each of the digits 1-9 must occur exactly once in each row. 2. Each of the digits 1-9 must occur exactly ...
GitHub
github.com › chenqi0805 › OOP-in-Python › blob › master › Leetcode.ipynb
OOP-in-Python/Leetcode.ipynb at master · chenqi0805/OOP-in-Python
Object Oriented Programming in Python. Contribute to chenqi0805/OOP-in-Python development by creating an account on GitHub.
Author chenqi0805
LeetCode
leetcode.com › problems › verifying-an-alien-dictionary › solutions › 468335 › Object-Oriented-Solution-Python
Verifying an Alien Dictionary - LeetCode
We cannot provide a description for this page right now
LeetCode
leetcode.com › problems › score-of-parentheses › discuss › 170554 › Easy-to-understand-object-oriented-Python-Solution
Easy to understand object oriented Python Solution
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
LeetCode
leetcode.com › problems › my-calendar-i › solutions › 1474303 › python-object-oriented-design-approach
My Calendar I - LeetCode
Can you solve this real interview question? My Calendar I - You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). The event can be represented as a pair of integers startTime and endTime that represents a booking on the half-open interval [startTime, endTime), the range of real numbers x such that startTime
LeetCode
leetcode.com › discuss › general-discussion › 962321 › is-there-a-resource-for-oop-or-practical-coding-questions-andor-solutions
Is there a resource for OOP or "practical coding" questions and/or ...
I know there are questions tagged "design", but these are usually just asking to implement a few methods, and don't really test OOP or library usage of the program such as with Byteboard interviews. While people have posted some in the discussion here tagged "object-oriented design", several of them are actually systems design interviews, and very few have any decent solutions, and they are almost always in Java (nothing for Python).
LeetCode
leetcode.com › discuss › study-guide › 1368302 › python-oop
Python OOP - Discuss - LeetCode
Write the Director class with the required methods to give the following outputs as shown. # Write your codes here. # Do not change the following lines
LeetCode
leetcode.com › discuss › post › 1583544 › oop-python-on-leetcode
OOP Python on leetcode - Discuss - LeetCode
I was doing this problem that including python linked-lists, and I wanted to redefine the > and < operators for the linked-lists ie: · however when I run the code, the inputed linked-list is of type: <class 'precompiled.listnode.ListNode'> whereas my linked-list object is of type: <class ...
LeetCode
leetcode.com › discuss › post › 4454824 › Top-20-OPP'S-Object-Oriented-Important-Questions-With-Detailed-Answers
Top 20 OPP'S Object Oriented Important Questions With Detailed Answers - Discuss - LeetCode
Top 20 OOP Interview Questions with Answers ## 1. What is OOP? - Answer: OOP stands for Object-Oriented Programming. It's a programming paradigm based on t
Blind
teamblind.com › tech › the leetcode for object oriented programming
The leetcode for object oriented programming | Tech Industry - Blind
January 6, 2024 - Anyone know where to practice oop interview questions like letcode? 43142 · Hide company name0 credits left · Post · Sort by : Cognizant pSvQ25 Jan 6, 2024 · Check out https://leetcode.com/tag/design/ and https://github.com/prasadgujar/low-level-design-primer/blob/master/solutions.md WGMI ·
LeetCode
leetcode.com › discuss › study-guide › 1852219 › Object-Oriented-Programming-Made-Easy
Loading...
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Quora
quora.com › Should-I-learn-OOP-data-structures-and-algorithms-before-practicing-on-LeetCode
Should I learn OOP, data structures, and algorithms before practicing on LeetCode? - Quora
Answer (1 of 3): Theory and practice go together. You cannot understand theory without any practice, and you have nothing to practice with no theory. Start with the simple stuff (variables, types, assignment, loops and conditions, common operations (+ ; - ; * ; / ; % ), then functions, recursions...
LeetCode
leetcode.com › discuss › post › 1852219 › object-oriented-programming-made-easy-by-r383
Object Oriented Programming Made Easy - Discuss - LeetCode
Methods - A method is a procedure or function in OOPs Concepts.
Python.org
discuss.python.org › python help
Why does LeetCode use solution class? Does the class ever help? - Python Help - Discussions on Python.org
February 24, 2022 - This is LeetCode question #1. I was wondering why LeetCode likes to use a solution class. I reformat the solution to a function without a class and call it: def twoSum2(nums, target): hashmap = {} for i in range(len(nums)): complement = target - nums[i] if complement in hashmap: return [i, hashmap[complement]] hashmap[nums[i]] = i nums1 = [2,7,11,15] target1 = 9 sol2 = twoSum2(nums1, target1) print(sol2) Output: [1, 0] This is LeetCode’s solution ...
YouTube
youtube.com › watch
The Problem with Object-Oriented Programming - YouTube
🚀 https://neetcode.io/ - A better way to prepare for Coding InterviewsClip from the video: https://www.youtube.com/watch?v=04ksL1hf_p8I stream on my main YT...
Published January 7, 2024