belongs to collection: Python Array Programs
Matrix in python is a two-dimensional data structure which is an array of arrays.
Program to filter matrix based on a condition
print("All students : ", T)
for t in T:
print("Students with score more than 70 : " , R)
All students : (('Ajay', 90), ('Peter', 45), ('Jack', 80))
Students with score more than 70 is (('Ajay', 90), ('Jack', 80))
In the above code, we have created the matrix T, with student name and marks. And then printed the value. The filter is using the greater than sign and store to an array. Then print this matrix.
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.