Python super() ফাংশন

প্রকল্পনা

একটি ক্লাস তৈরি করুন যা অন্য ক্লাস থেকে সবকিছু পদ্ধতি ও গুণকে উত্তরসূরী করবে:

class Parent:
  def __init__(self, txt):
    self.message
  def printmessage(self):
    print(self.message)
class Child(Parent):
  def __init__(self, txt):
    super().__init__(txt)
x = Child("Hello, and welcome!")
x.printmessage()

চালু হওয়ার প্রক্রিয়া

সংজ্ঞা ও ব্যবহার

super() ফাংশন পিতৃশ্রেণী বা সহস্রশ্রেণীর পদ্ধতি এবং গুণগুলির প্রবেশ দেয়।

super() ফাংশন পিতৃশ্রেণীর উপরের উপাদানকে প্রতিনিধিত্ব করে।

গঠনশৈলী

super()

প্যারামিটার মান

কোনও প্যারামিটার