Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 anything

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago