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
dicteperations
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 & add the number to the list of primes.
if the length of any of the above lists is greater than exit the loop and add the lists to the dictionary.
print the dictionary.
Hint: Write a fnuction called isprimenumber that returns True if the number is prime, otherwise False.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
