Thursday, January 11, 2024

Python 3 : The Class

 class kelas1:  
   def __init__(self, nama, usia):  
     self.nama = nama  
     self.usia = usia  
   def __str__(self):  
     return "Tampilkan nama : %s , usia : %s" % (self.nama, self.usia)  
 isian = kelas1("Steven", 17)  
 print(isian)  

This is the Initial Source Code for Learning About Classes in Python Programming.

Understanding classes in Python programming will be useful for understanding how to create tables using Flask Table.

A class is a group of functions.

We want to learn how to inherit in classes in Python programming. We can only inherit within the same class, which is inheritance between functions.

No comments:

Post a Comment