/learn_python

Learn the tools and conventions of Python coding

Primary LanguagePythonMIT LicenseMIT

============================ Learn Python Through Testing

Welcome!

The purpose of this project is to provide you with an introduction to the tools and conventions of Python development. It is assumed that you are familiar with scripting in Python. Instead, these exercises will focus on using GitHub, test-driven development, and the conventions that Python coders use every day.

How to proceed:

  1. Getting Started.

    • Create your own GitHub account.

    • Fork this repository into your own GitHub account.

    • Download the repo to your computer in one of these ways:

      • Install & use the GitHub Desktop Application
      • or click on the 'Clone or Download' button
    • Explore the files in this project.

    • Open module_0.py and run it. (This will also run the tests.)

    • Try to use the functions in module_0.py from the IPython console.

      • after running module_0.py inside of IPython, type: >>> hello_world()
      • You can also list all of the functions stored in module_0 this way: >>> dir(module_0)
      • Learn more about the function hello_world(): >>> help(hello_world()
    • Try to run the tests. I've set up four different ways:

      • run module_0 from the IPython interpreter
      • run test_module_0 from the IPython interpreter
      • run unittest from the command line:

      C:\Users\x\Google Drive\PythonWorkspace\learn_python>python -m unittest -v

      • run the setup file with the test option (setup.py is a file that gets used to create a package):

      C:\Users\x\Google Drive\PythonWorkspace\learn_python>python setup.py test

  2. A Simple Coding Exercise: module_1.py

    In this module, you'll familiarize yourself with the concept of unit testing and how these modules will work.

    • Switch branches to module_1 to get the instructions for this exercise.
  3. Odd-Even Excercise: module_2.py

    Create a function that returns only odd numbers.

    • Switch branches to module_2 to get the instructions for this exercise.