Welcome to Westonci.ca, the ultimate question and answer platform. Get expert answers to your questions quickly and accurately. Explore thousands of questions and answers from a knowledgeable community of experts ready to help you find solutions. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Python Activity

We pass in a 2 dimensional list. You should output the 3rd element of the 2nd row.
--------------------------------------
Requirements:
Program Output
Program Failed for Input: "" 1,2,4 ""
Expected Output: 4
--------------------------------------
Given code:
# Get our list from the command line arguments
import sys
list2d= sys.argv[1:]
# Convert the command line arguments into 2d list
for i in range(0,len(list2d)):
list2d[i]= list2d[i].split(',')
# Write your code below

Sagot :

The code for output the 3rd element of the 2nd row in python is print(list2d[1][2])

The complete code in python is,

# Get our list from the command line arguments

import sys

list2d= sys.argv[1:]

# Convert the command line arguments into 2d list

for i in range(0,len(list2d)):

list2d[i]= list2d[i].split(',')

# Write your code below

print(list2d[1][2])

The print function will display the output.

Then the first parameter in list2d is to indicate the row (as usual the index start from 0, so the 2nd row is 1) and the second parameter in list2d is to indicate the element (index also start from 0, so the 3rd element is 2).

Learn more about python here:

brainly.com/question/26497128

#SPJ4