Question: In python, Create a method called dict _ eperations that will perform the following. create an empty dictionary. take only integer inputs from the user.

In python, Create a method called
dict_eperations
that will perform the following.
create an empty dictionary.
take only integer inputs from the user.
if the number is not a digit pass.
if the number is even, add the number to the list of even numbers.
if the number is odd, add the number to the list of odd numbers.
if the number is prime, in addition to 3&4, add the number to the list of primes.
if the length of any of the above lists is greater than 5, exit the loop and add the lists to the dictionary.
print the dictionary.
Hint: Write a fnuction called is_prime(number) that returns True if the number is prime, otherwise False.
 In python, Create a method called dict_eperations that will perform the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!