Question: #Please use Python to answer the questions #I have done the Q1 and Q2, please help me finish Q3 correctly. #Q1 def prod_of_digits(n): P=1 while
#Please use Python to answer the questions #I have done the Q1 and Q2, please help me finish Q3 correctly.
#Q1 def prod_of_digits(n): P=1 while n: P *= n % 10 n = n // 10 return P
for n in [235,205,11,2,1234]: print(n,prod_of_digits(n))
#Q2 sum = 0 for i in range(2000,12000): prod = prod_of_digits(i) if prod>=400 and prod<=600: sum = sum + prod
print('''Sum of integers from 2000 to 12000 having digit product between 400 and 600 is:''',sum)
#Q3
(a) Count the number of ints from Q2 that have no repeating digits. For example, 2231 has repeating 2's, but 2134 has no repeating digits. Show your results.
(b) Find the minimum and the maximum of these ints. Show your results.
(c) Find the average of these ints. Show your results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
