Take two numbers (separated by a space) as user input in a single line which will be used as a range (both numbers inclusive) later. Your task is to create and print a Python dictionary where the keys...


Take two numbers (separated by a space) as user input in a single line
which will be used as a range (both numbers inclusive) later. Your task is
to create and print a Python dictionary where the keys will be numbers from
that range and the corresponding values will be the odd factors (divisors)
of that number in a tuple.


Sample Input 1:
10 15


Sample Output 1:
{10: (1, 5), 11: (1, 11), 12: (1, 3), 13: (1, 13), 14: (1, 7), 15: (1, 3,
5, 15)}


Explanation 1:
In this dictionary, the keys contain numbers from the range 10 to 15 and
the value corresponding to a number is a tuple which consists of the odd
factors of that number.
-----------------------------------------------------------------
Sample Input 2:
20 23


Sample Output 2:
{20: (1, 5), 21: (1, 3, 7, 21), 22: (1, 11), 23: (1, 23)}


Explanation 2:
In the dictionary, the keys contain numbers from the range 20 to 23 and the
value corresponding to a number is a tuple which consists of the odd
factors of that number.




Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here