Question: The Gravity Equation Function Name: gravityEquation ( ) Parameters: calculations ( str ) Returns: correctResults ( list ) Description: As a new NASA hire, you
The Gravity Equation
Function Name: gravityEquation
Parameters: calculations str
Returns: correctResults list
Description: As a new NASA hire, you have been tasked with helping Murph, a brilliant NASA sci
entist, solve the gravity equation.
You are given a parameter, calculations str which contains multiple "calculations" separated by
underscores Each calculation is mix of digits and letters. Write a function that analyzes each
calculation by counting how many digits and letters it contains. If the number of digits and letters in
the calculation are equal, then that calculation is considered valid. For each valid calculation, ex
tract and store only its digits. Return a sorted list of these integers in ascending order.
gg calculations ADAWBRELTHWGDFBMAECRKSFFVA
calculations PRIYASALEHDANNNYKIRITOBUZZ
gg gravityEquationcalculations
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
