subject

Matrix operations - python

def display_menu():
""" prints a menu of options
"""
print()
print('(0) enter a new matrix')
print('(1) negate the matrix')
print('(2) multiply a row by a constant')
print('(3) add one row to another')
print('(4) add a multiple of one row to another')
print('(5) transpose the matrix')
print('(6) quit')
print()

def print_matrix(matrix):
""" prints the specified matrix in rectangular form.
input: matrix is a 2-d list numbers
"""
## you will revise this function.
print(matrix)

def get_matrix():
""" gets a new matrix from the user and returns it
"""
matrix = eval(input('enter a new 2-d list of numbers: '))
return matrix

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:50
What does operator overloading allow you to do?
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
question
Computers and Technology, 24.06.2019 23:50
What is your fav video game currently: a) roblox b) fortnite c) apex legends d) pubg
Answers: 2
You know the right answer?
Matrix operations - python

def display_menu():
""" prints a menu of options
...
Questions
question
History, 20.11.2019 18:31
question
Mathematics, 20.11.2019 18:31
Questions on the website: 13722363