console.py
def do_count(self, line):
        """retrieve the number of instances of a class"""
        args = line.split()
        objects_dic = storage.all()
        if len(args) == 0:
            print("** class name missing **")
        elif args[0] not in new_c_list:
            print("** class doesn't exist **")
        pichu = 0
        for i in objects_dic:
            if objects_dic[i].__class__.__name__ == args[0]:
                pichu += 1
        print(pichu)
retrieve the number of instances of a class
retrieve the number of instances of a class
retrieve the number of instances of a class
def do_count(self, line):
        args = line.split()
        objects_dic = storage.all()
        if len(args) == 0:
            print("** class name missing **")
        elif args[0] not in new_c_list:
            print("** class doesn't exist **")
        pichu = 0
        for i in objects_dic:
            if objects_dic[i].__class__.__name__ == args[0]:
                pichu += 1
        print(pichu)
def do_count ( self , line ) : args = line . split ( ) objects_dic = storage . all ( ) if len ( args ) == 0 : print ( "** class name missing **" ) elif args [ 0 ] not in new_c_list : print ( "** class doesn't exist **" ) pichu = 0 for i in objects_dic : if objects_dic [ i ] . __class__ . __name__ == args [ 0 ] : pichu += 1 print ( pichu )
retrieve the number of instances of a class
retrieve the number of instances of a class
"""retrieve the number of instances of a class"""
self
line