1
$\begingroup$

Is there any recommendation on an online platform that teaches and allows practicing object-oriented programming (OOP) in Python?

I am familiar with Hackerrank and HackerEarth, however, they do not have practice problems related to Object-Oriented Programming in Python but they do have problems related to other concepts.

$\endgroup$
4
  • 2
    $\begingroup$ I don't think that any such resource exists, though I would love to be wrong about that. $\endgroup$
    – Ben I.
    Apr 22, 2021 at 12:27
  • $\begingroup$ Can you be more specific on "practice for OOP"? Maybe looking in the SELF / Smalltalk / old Javascript area or reading through Bertrand Meyer's books might be helpful. $\endgroup$
    – DarkTrick
    Apr 24, 2021 at 11:29
  • 2
    $\begingroup$ Why not take any book with exercises and do them online? And why is online so much better than in a local IDE? $\endgroup$ Feb 27, 2022 at 15:10
  • $\begingroup$ @VictorEijkhout And why is online so much better than in a local IDE? – As in answer below regarding REPL.IT, code can be shared with and executed by a teacher / mentor / more experienced programmer, who can help learning overcome difficulties - and can be done in real-time while discussing the code and reasons for the chnages - I do this all the time when supporting new learners of Python. W3Schools "embedded" code is also a very powerful teaching aid - if the student attempts the exercises. $\endgroup$
    – Clive Long
    Apr 21, 2023 at 12:40

1 Answer 1

2
$\begingroup$

replit.com allows you to code online and you can also set up tests for the Repl, as well as embed the code into a blog or LMS.

I've an example here based on a tutorial here. You'd need an account to "collaborate" but the images are below.

The code runs the main.py file when the "Run" button is activated.

I made a Point class in point.py and this is called from the main in main. the Point class

There are other features such as version control, sharing for a collab, database, forking, etc. the main file that gets exeuted

Repl introduced classroom some time ago- the demo video shows some of the capabilities for assignments. Last year this was replaced by Teams for Education.

While better, it is not free, but there is a 4-month free trial -- you can see a demo of this "update" here.

Each student "gets their own copy" of an assignment, and the interface is quite pleasant- they can see due dates, status, etc, and you can build in unit tests that they should pass before submitting an assignment.

Student view of assigned work

Github classroom (demo here) is another option but may not be the easiest to start with. Using Repl you could at least share code and have the class make their own Repls and write code to pass tests, or code a class given a class diagram or problem statement.

Hope this helps. Not exactly OOP Codingbat but might give you some ideas. Another useful site is this. It approaches OOP with Python using games. PyGame will run in repl as well, allowing some collaboration on games with many classes to be completed. An assignment can allow each student to get a fork of what you post, OR allow students in groups to get a fork between a group.

$\endgroup$
2
  • 2
    $\begingroup$ REPlit.com Teams for Education is now free. $\endgroup$ Sep 13, 2022 at 23:32
  • $\begingroup$ Yes, I was paying for it myself as it was worth having.... I was glad to see it become free though. It is massively beneficial that I can see who has started a lab (shows fork time), who has coded a solution, who tested and submitted, and who has had it reviewed (by me). Compared to when I used to have them upload to moodle, then download and review, now I write tests for all the lab functions, can leave comments (not #, but a thread like in MS Word) and so on. I can't recommend it enough. $\endgroup$
    – srattigan
    Sep 28, 2023 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.