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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 11:00, jaygamer37
What is the name of the sound effect that danny hears
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, yeet74
Ahousehold consists of a married couple and their twin five-year old daughters. the couples children had no income and lived with their parents all of last year. how many exemptions can the couple claim on last years tax return or they file with the “ married filing jointly “ status? a. 4 b. 5 c. 3 d. 2
Answers: 1
image
Computers and Technology, 25.06.2019 05:30, mariposa91
The police department is excited to have some new motorcycle units. one officer said that these motorcycles can go from 0 miles per hour to 80 miles per hour in just 6 seconds. the officer is describing the motorcycle's a. average speed. b. distance. c. average velocity. d. acceleration.
Answers: 1
image
Computers and Technology, 25.06.2019 11:30, scottytohotty
The function of network switch is to
Answers: 1
You know the right answer?
Matrix operations - python

def display_menu():
""" prints a menu of options
...

Questions in other subjects:

Konu
English, 23.11.2021 03:20
Konu
Mathematics, 23.11.2021 03:20