Question: Write a Python program that prompts the user to input a positive number n (the number should be validated) and print an identity matrix
Write a Python program that prompts the user to input a positive number n (the number should be validated) and print an identity matrix of the desired size, n. N.B: If the entered number was float, it should be converted to integer. Expected Output: Enter a positive number: -3 Wrong entry! Enter a positive number: 4.2 1 0 0 0 0 1 0 0 0 0 10 0001
Step by Step Solution
There are 3 Steps involved in it
It seems like you are asking for a Python program that prompts the user for a posit... View full answer
Get step-by-step solutions from verified subject matter experts
