Question
PLEASE WRITE IN PYTHON and include a comment describing lines of code Part 5 Move all of your functions into an external module. This can
PLEASE WRITE IN PYTHON and include a comment describing lines of code
Part 5
Move all of your functions into an external module. This can be done by creating a new .py file in the same folder as your source code file. You can then "import" the functions from this file by using the following syntax:
import myfunctions
... assuming that the file you created is named "myfunctions.py". You can then call your functions in your main source code file using "dot syntax", like this:
myfunctions.check_answer(1,1,2,"+")
Part 6
Finally, put everything together and write a program that lets the user practice a series of random addition and subtraction problems. Begin by asking the user for a number of problems (only accept positive values) and a size for their numbers (only accept numbers between 5 and 20). The generate a series of random addition and subtraction problems - display the numbers to the user with your digital display functions. Then prompt the user for an answer and check the answer using your check_answer function. Your program should also keep track of how many correct questions the user answered during their game. Here's a sample running of the program:
How many problems would you like to attempt? -5 Invalid number, try again How many problems would you like to attempt? 5 How wide do you want your digits to be? 5-20: 3 Invalid width, try again How wide do you want your digits to be? 5-20: 5 Here we go! What is ..... ***** * ***** * ***** * * ***** * * * * * * * = 4 Correct!
more info about the problem can be found here
https://www.chegg.com/homework-help/questions-and-answers/please-write-pyhton-need-help-5-6-include-code-parts-1-4-end-please-try-include-descriptio-q28021730
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started