Question: Define a function that takes two integers x and k as parameters. The function should divide x into k (mostly) equal integers and combine each
Define a function that takes two integers x and k as parameters. The function should divide x into k (mostly) equal integers and combine each of these integers into a list. The function should return this list. The value of k has to be a positive integer; if it isnt, an error message should be displayed. To test your function, read two integers from the user, call the function by passing these two integers as arguments and print the list returned from the function. Warning: You are not allowed to use any built-in functions; you are supposed to compute the result using iterations.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
