pick function implemented

This commit is contained in:
SebastianoF 2019-11-21 22:49:14 +00:00
parent 44ed8577b3
commit 25fdc1c6a0
2 changed files with 10 additions and 3 deletions

View File

@ -1,8 +1,8 @@
v get a single python file with all questions, hints and answers in a single dictionary.
v implement 3 functions: question, hint and solution, printing the required question, hint and solution in an `initialise.py` file.
v initialise must also have a pick() function for a random game.
+ produce one jupyter with all the questions, the initialise.py in the first cell creating the full notebook: numpy_100_consecutive.ipynb
+ produce one jupyter notebook with the random game. initialise must also have a pick() function to get a random question: numpy_100_random.ipynb.
+ produce one jupyter notebook with the random game: numpy_100_random.ipynb.
+ produce the method to create the md files (questions, questions with hints, questions with solutions, questions with hints and solution)
+ add to this method the a cli interface for quick manipulation.
+ produce and leave the files created with the cli.

View File

@ -1,8 +1,10 @@
import numpy as np
from questsions_dict import qha
def question(n):
print(qha[f'q{n}'])
print(f'{n}. ' + qha[f'q{n}'])
def hint(n):
@ -11,3 +13,8 @@ def hint(n):
def answer(n):
print(qha[f'a{n}'])
def pick():
n = np.random.randint(1, 100)
question(n)