'Write a script that ask the user to enter n-(size of the matrix) from Keyboard then creat a random Matrix M of size (n*n) where the values between (0-1) , and then determine the sum of non-diagonal elements display sum on screen ? 11.10'
Added by Andrea D.
Step 1
Ask the user to enter the size of the matrix (n). Show more…
Show all steps
Your feedback will help us improve your experience
Aarya B and 61 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
(Explore matrix) Write a program that prompts the user to enter the length of a square matrix, randomly fills in 0 s and 1 s into the matrix, prints the matrix, and finds the rows, columns, and major diagonal with all 0s or all ls. Here is a sample run of the program:
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD