{
"name": "js-personal-projects",
"version": "0.0.1",
"description": "Lectrum JS + ES6 course personal projects",
"author": {
"name": "Andrey Prisniak",
"email": "aprisniak@lectrum.io"
},
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config webpack/webpack.config.prod.js",
"start": "webpack serve --mode development --env development --config webpack/webpack.config.dev.js",
"start:prod": "npm run build && serve build/"
},
"keywords": [
"webpack",
"frontend",
"es6",
"javascript"
],
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.12.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.2.1",
"cross-env": "^7.0.2",
"css-loader": "^5.0.0",
"eslint": "^7.11.0",
"eslint-loader": "^4.0.2",
"file-loader": "^6.1.1",
"html-webpack-plugin": "^4.5.0",
"mini-css-extract-plugin": "^1.0.0",
"sass": "^1.32.11",
"sass-loader": "^10.0.3",
"style-loader": "^2.0.0",
"webpack": "^5.1.3",
"webpack-cli": "^4.0.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.2.0"
},
"dependencies": {
"@babel/polyfill": "^7.12.1",
"core-js": "^3.6.5",
"date-fns": "^2.16.1",
"serve": "^11.3.2"
}
}
questions = ["My name ___ Vova ", "I ___ a coder ", "I live ___ Moscow "]
answers = ["is", "am", "in"]
questions.append("What is the best programming language ")
answers.append("Python")
user_message = input(f"Привет! Предлагаю проверить свои знания английского! Наберите 'ready', чтобы начать ")
def faq():
"""
Функция для вывода опроса
"""
counter = 0
scores = 0
for question, correct_answer in zip(questions, answers):
attempt = 3
while attempt > 0:
answer = input(question)
if answer.lower() == correct_answer.lower():
counter += 1
if attempt == 3:
scores += 3
elif attempt == 2:
scores += 2
elif attempt == 1:
scores += 1
else:
scores += 0
print("Ответ верный!")
print(f"Баллы за правильный ответ {scores}")
print(f"Попытка {attempt}")
break
elif attempt == 0:
print(f"Увы, но нет. Верный ответ {correct_answer}")
print(f"Баллы за правильный ответ {scores}")
break
else:
attempt -= 1
print(f"Неправильно. Осталось {attempt} попыток")
print(f"Баллы за правильный ответ {scores}")
sum_questions = len(questions)
percent = round((100 / sum_questions) * counter)
print(f"Вот и все, "
f"\nВы ответили на "
f"{counter} вопросов из {sum_questions} верно,\nэто "
f"{percent} процентов и {scores} баллов")
def count_attempt(attempt, scores):
if attempt == 3:
scores += 3
elif attempt == 2:
scores += 2
elif attempt == 1:
scores += 1
else:
scores += 0
return scores
if user_message == "ready":
faq()
else:
print("Кажется вы не хотите играть. Очень жаль")