Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

module "library" has no attribute "KAKA"

it doesn’t do the function. it writes an error.

main.py:


import library

library.KAKA(10, 20)

library.py:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


class KAKA():
    def __init__(self, fruits, vegetables):
        self.fruits = fruits
        self.vegetables = vegetables
    def get_results(self):
        print(self.vegetables)
        print(self.fruits)

i tried this, but it didn’t work

>Solution :

You should do:

from library import KAKA

and then:

KAKA(10, 20)

This is called an "explicit import".

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading