Giter Site home page Giter Site logo

python-exercises's Introduction

Simple Python exercises

Build Status

Set of solutions for 46 Simple python exercises, a list of exercises to introduce people to the Python programming language.

This list of exercises comprises logical operators, loops, input and output, regular expressions and more in order for people to have a basic overview of the language.

In order for better categorization, the exercises have been divided into 4 sections.

  1. Very Simple Exercises
  2. Higher Order Functions and List Comprehension
  3. Simple exercises including Input and Output
  4. Somehow harder exercises

Getting started

To execute a function from the set, just clone the repository or download the .zip containing all the files, then change directory into python-exercises/sections, open the python command line and import the module in which the exercise you want to run is in and then call it.

$ git clone https://github.com/PabloVallejo/python-exercises.git
$ cd python-exercises/sections
$ python

Python 2.7 (r27:82525, Jul ......
>>> import module_1
>>> module_1.historygram( [ 1, 2, 3 ] )
   *
   **
   ***

Running tests

There is also a test suite for this exercises, the purpose of it is first, so that users can refactor things without breaking something, and second, for having a basic reference on how to test functions and use the basic unittests methods.

$ cd python-exercises
$ python tests.py
.........................................
----------------------------------------------------------------------
Ran 41 tests in 0.218s

OK

Contributing

Everyone is welcome to contribute. Feel free to submit a pull request, issue or suggestion you may find relevant.

Reference

The original collection of exercises was created by Torbjörn Lager ([email protected]) and can be found here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.