Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started