sprajjwal / madlibs

0 stars 0 forks source link

Madlibs Feedback #1

Open natepill opened 5 years ago

natepill commented 5 years ago
sprajjwal commented 5 years ago

I don't know if i could add test cases for programs with no conditionals. As of global scope, I didn't know python used a main function and that's why all my code is globally scoped and not in a main function. I will try to not repeat that.

natepill commented 5 years ago

There are ways to test your code without simply conditionals. Conditionals work great with unit testing which is something we will be covering later on in the course. For this project, you could simulate static user input inside a test function that calls your helper functions and print the results to see if the output matches expected results. If you want clarification on this, we'll talk about it at office hours.

natepill commented 5 years ago

Python has a main function that is written like so:

if __name__ == "__main__":
# run code here

Whenever a python file is run, whatever is written inside the main function is where the python program starts looking for code to execute.