-2
class Play:
    def __init__(self):
        a = 7
        b = 7
        return a + b
    class Learn:
        def __init__(self, a, b):
            self.a = a
            self.b = b
            return a - b

Python class This is just an example of how a nested class look like. I don't find how to take advantage of a nested class and nested function. Who knows what the use of nested class and function will result in? You can take your adventure in programming to try to see what a nested class might offer.

Ch3steR
  • 20,090
  • 4
  • 28
  • 58
Huna Bopa
  • 1
  • 1
  • Please check [How to ask homework questions in SO](https://meta.stackoverflow.com/questions/334822/how-do-i-ask-and-answer-homework-questions). – PatioFurnitureIsCool Aug 31 '23 at 05:50
  • Nested classes could be used to group related classes and avoid naming conflicts I guess. – Cow Aug 31 '23 at 05:51

0 Answers0