You can use the vars() function to get the instance variables of a class object as a dictionary. Then you can loop through the keys and values in the dictionary to print them.
Solution :
class MyClass:
def __init__(self, a, b, c):
self.a = a
self.b = b
self.c = c
ClassData = [MyClass(1, 2, 3), MyClass(4, 5, 6), MyClass(7, 8, 9)]
for i in range(len(ClassData)):
instance_vars = vars(ClassData[i])
for var_name, var_value in instance_vars.items():
print("{var_name}: {var_value}")