Please write a function named count_matching_elements (my_matrix: list, element: int), which takes a two-dimensional array of integers and a single integer value as its arguments. The function then counts how many elements within the matrix match the argument value. An example of how the function should work: m = [[1, 2, 1], [0, 3, 4], [1, 0, 0]] print (count_matching_elements (m, 1)) 3 Sample output
Please write a function named count_matching_elements (my_matrix: list, element: int), which takes a two-dimensional array of integers and a single integer value as its arguments. The function then counts how many elements within the matrix match the argument value. An example of how the function should work: m = [[1, 2, 1], [0, 3, 4], [1, 0, 0]] print (count_matching_elements (m, 1)) 3 Sample output
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
Related questions
Question
Can you use Python
Thanks
![Please write a function named count_matching_elements
(my_matrix: list, element:
int), which takes a two-dimensional array of integers and a single integer value as its
arguments. The function then counts how many elements within the matrix match the
argument value.
An example of how the function should work:
m = [[1, 2, 1], [0, 3, 4], [1, 0, 0]]
print (count_matching_elements (m, 1))
3
Sample output](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1e81da3a-685f-4a1c-b0d8-bdbcceea4042%2F8ed44cb7-6b37-4153-98f7-df39b062a3cc%2Fo1ye8rn_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Please write a function named count_matching_elements
(my_matrix: list, element:
int), which takes a two-dimensional array of integers and a single integer value as its
arguments. The function then counts how many elements within the matrix match the
argument value.
An example of how the function should work:
m = [[1, 2, 1], [0, 3, 4], [1, 0, 0]]
print (count_matching_elements (m, 1))
3
Sample output
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning