- Fork this repository under your own account
- Clone the forked repository to your computer
- Commit your progress frequently and with descriptive commit messages
- All your answers and solutions should go in this repository
- You can use any resource online, but please work individually
- Instead of copy-pasting your answers and solutions, write them in your own words.
The application is accepted if:
- The solution works according to specification [1p each]
- The solution follows styleguide [1p]
- Has proper error handling where the specification says it [1p each]
- Has the correct loops, methods, filters [1p each]
- The code is clean, without unnecessary repetition, and with descriptive names [1p each]
- You commit frequently with descriptive commit messages [1p]
flowchart: https://drive.google.com/file/d/0B99ved1Ls044aUpRd25CX2puNFk/view?usp=sharing
You should import the random module. The easiest way is using the randint(a, b) function. It gives back random integer numbers in range between 'a' and 'b'. Example: import random
print(random.randint(0, 10) 5
Or you can use the randrange(a, b, c) function. It gives back a number between 'a' and 'b'. The 'c' argument is the step. The function sees only the 'c'nth element in the 'a''b' range. Example:
print (random.randrange(5)) # a random element in range 0-5. 1 print (random.randrange(1,5)) # a random element in range 1-5. 2 print (random.randrange(1,10, 1)) # a random odd element in range 1-10. 7
M means the Model in the MVC. The model manages all of the datas, the calculations, the rules, the logic of the application. The controller sends to and pull datas from it. It doesn't communicate with the view.