Answer to Question #145780 in Python for a

Question #145780
Edhesive 10.4:
For this exercise, use the following 2D array, which is already declared and initialized in your programming environment below.

34 38 50 44 39
42 36 40 43 44
24 31 46 40 45
43 47 35 31 26
37 28 20 36 50
Your task is to determine whether each item in the array above is divisible by 3 or not. If an item is divisible by 3, then leave that value as-is in the array, but if it is not divisible by 3, then replace that value in the array with a 0. Remember that you will need to use modular division from Unit 2 to determine if a value is divisible by 3. Finally, print out the array in the format as seen in the sample run below.

Note: Be sure that your program accounts for arrays of any size, not just arrays that are 5 x 5. Your program will be tested against arrays of size n by n. It should work for any square array, not just the one shown. You should also use for loops in your program, not while loops.
1
Expert's answer
2020-11-20T19:59:56-0500
Dear a, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS