Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

How to test a class? In problem 5 we are creating classes but there is no apparent method to test them to see if we wrote them correctly. If I put a class in a separate file, how could I test this class for proper implementation?

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

Creat your own def with some set parameters and show (print) them, to see if you get what you want.
All these "self" terms to specify which class confuse me. It seems like they should be implicit, not explicit. Seems like extra writing for something that is obvious. But, yes, I see now how you can make a file for each class and test them out separately by using simply outputs and inputs. class WordTrigger(Trigger): def __init__(self,word): self.word = word def is_word_in(self,text): if self.word in text: return True else: return False
Is kinda confussing the "self" at the beginning, but necessary :/

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question