Question: 1. Write a Python program in a file called processStrings.py which, given a number of strings of digits, uses a main function to test
1. Write a Python program in a file called processStrings.py which, given a number of strings of digits, uses a main function to test the following functions: (a) processStr which, given a string of digits, computes and prints the sum and the product of the numbers in the string; (b) getHighest which returns the largest digit/number in the string; (c) getHasRepeatDigit which calls and returns the result from the function getHighest if the string has no repeated digits and zero otherwise. Sample input/output: Enter a string of digits to process or 'quit' to stop: 3294751 The sum of the digits in 3294751 is 31 The product of the digits in 3294751 is 7560 The string has no repeated digits. The highest digit in the given string is: 9 Enter a string of digits to process or 'quit' to stop: 454182 The sum of the digits in 454182 is 24 The product of the digits in 454182 is 1280 repeated digits. The string has Enter a string of digits to process or 'quit' to stop: 832015 The sum of the digits in 832015 is 19 The product of the digits in 832015 is 0 The string has no repeated digits. The highest digit in the given string is: 8 Enter a string of digits to process or 'quit' to stop: 22222 The sum of the digits in 22222 is 10 The product of the digits in 22222 is 32 The string has repeated digits. Enter a string of digits to process or 'quit' to stop: quit
Step by Step Solution
There are 3 Steps involved in it
Python def processStrdigits digitslist intdigit for digit in digits digitsum su... View full answer
Get step-by-step solutions from verified subject matter experts
