find_solvable_blackout_equation(num_tries, n, pct_per_digit): Takes one positive integer, one positive odd integer, and one float in [0, 1[ as input. Randomly creates and returns a solvable Blackout Math equation of length n and with each number having the given percent chance to have more than one digit. If such an equation cannot be generated after the given number of tries, then return None instead.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter6: Creating, Sorting, And Querying A Table
Section: Chapter Questions
Problem 10EYK
icon
Related questions
Question

Please use python

• find_solvable_blackout_equation(num_tries, n, pct_per_digit): Takes one positive integer, one
positive odd integer, and one float in [0, 1[ as input. Randomly creates and returns a solvable
Blackout Math equation of length n and with each number having the given percent chance to have
more than one digit. If such an equation cannot be generated after the given number of tries, then
return None instead.
>>> random. seed(42)
>>> find_solvable_blackout_equation(1000, 7, 0.2)
[37, '+', 9, '=', 1, 'x', 6]
>>> random.seed(1337)
>>> find_solvable_blackout_equation(1000, 13, 0.25)
[9, '/', 3, /', 6, '=', 4, '/', 71, '-', 6, '+', 5]
Transcribed Image Text:• find_solvable_blackout_equation(num_tries, n, pct_per_digit): Takes one positive integer, one positive odd integer, and one float in [0, 1[ as input. Randomly creates and returns a solvable Blackout Math equation of length n and with each number having the given percent chance to have more than one digit. If such an equation cannot be generated after the given number of tries, then return None instead. >>> random. seed(42) >>> find_solvable_blackout_equation(1000, 7, 0.2) [37, '+', 9, '=', 1, 'x', 6] >>> random.seed(1337) >>> find_solvable_blackout_equation(1000, 13, 0.25) [9, '/', 3, /', 6, '=', 4, '/', 71, '-', 6, '+', 5]
Expert Solution
steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L