Embed presentation
Download to read offline
![n = int(input())
m = int(input())
A = []
for i in range(n):
string = input().split(' ')
s = [int(i) for i in string]
A.append(s)
a = A[n-2][m-1]
k = 0
for i in range(n):
for j in range(m):
if A[i][j] == a:
k = k + 1
print(k)](https://image.slidesharecdn.com/test-221005064747-a072ebde/75/Testing-file-for-download-1-2048.jpg)
This program takes in two numbers n and m as input, then builds a 2D list A of size n x m from user-provided space-separated integers. It counts the number of occurrences of the integer located at index n-2, m-1 of A and prints the result.
![n = int(input())
m = int(input())
A = []
for i in range(n):
string = input().split(' ')
s = [int(i) for i in string]
A.append(s)
a = A[n-2][m-1]
k = 0
for i in range(n):
for j in range(m):
if A[i][j] == a:
k = k + 1
print(k)](https://image.slidesharecdn.com/test-221005064747-a072ebde/75/Testing-file-for-download-1-2048.jpg)