Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use python Question . One method to determine if an integer is a multiple of 9 is to sum the individual digits, then continue
please use python
Question . One method to determine if an integer is a multiple of 9 is to sum the individual digits, then continue to sum the resulting values until you have a one-digit result. For example, the integer 1863 can be verified as a multiple of 9 by adding the digits (1+8 6 3 18), then adding the digits of the resulting value (1+8-9). Since the final single digit answer is 9, then we know that the starting value was an even multiple of 9. Define a function named q60 that accepts an integer as a parameter, then (using only string manipulation and integer addition), creates a list of all the values obtained by adding the digits together until arriving at a single digit final answer. The function should return the list of resulting values. If the parameter string does not contain only digits, the function should return an empty list. Example output of function q6(0 at the interactive Python prompt: 0 1 >q6 ('Bob') f Doesn't contain digits, returns empty list [ 12, 3 ] >g6 ('9267304815') 45, 9 NOTE: Your q60 function should return only the list of values; it should not print anythingStep 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