From cd58a96b4184b32662b8796697d45e7ca3855ae2 Mon Sep 17 00:00:00 2001 From: Marcus Ferl Date: Tue, 22 Mar 2022 23:11:36 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Equestion=5Fanswer=5Foutput.py=E2=80=9C?= =?UTF-8?q?=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- question_answer_output.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 question_answer_output.py diff --git a/question_answer_output.py b/question_answer_output.py deleted file mode 100644 index 4c861af..0000000 --- a/question_answer_output.py +++ /dev/null @@ -1,24 +0,0 @@ -import json -from random import randrange - - -# Einlesen vom Json File -def read_json(filename): - with open(filename,encoding='utf-8') as filename: - data = json.load(filename) - return data - - -# Zufällige Frage erstellen -def random_question(filename): - min_ = 0 - max_ = len(read_json(filename)) - random_number = randrange(min_,max_) - questions = read_json(filename) - question = f'Frage #{random_number}: ' + questions[random_number][str(random_number)]['question'] - answer = questions[random_number][str(random_number)]['answer'] - return question, answer - - -#print(random_question(config.json_file)[0]) -