Come in fellow humans to this first example of smart contract. You can view the full source in Github and follow along.
If you are completely new to smart contract development, please go to ethereumdev.io to get the basics. It should not take long to learn, it took me ~2 weeks to learn the basics and run some experiments but your mileage may vary.
The best resource for debugging is the Remix IDE
The purpose of this contract is to run a simple lottery where the contract creator is in charge of supplying the lucky numbers. I will discuss later on why generating random numbers in a smart contract is almost never a good idea. Now, let me explain the structure of this exercise and some tools involved. The contract written in solidity (.sol file) is loaded and deployed with Python (>3.4) using Web3.py.
Lets go step by step so you can follow along:
There is nothing really fancy in this contract. Like in most Solidity contracts, most of the coding is spent dealing with array logic. This particular Lottery runs for as long as the owner wants and is closed by supplying the winning numbers manually. The winners are then copied to a separate array to split the prize evenly. For a complete discussion on how to securely generate a random number in a Solidity contract, please refer to this thread.
Please, feel free to send me any questions you might have regarding smart contracts or this one in particular. I will be more than happy to help => me @ jesusfloressanjose.com