Discover a wealth of knowledge and get your questions answered at IDNLearn.com. Our platform is designed to provide trustworthy and thorough answers to any questions you may have.

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

Your participation means a lot to us. Keep sharing information and solutions. This community grows thanks to the amazing contributions from members like you. IDNLearn.com has the solutions to your questions. Thanks for stopping by, and come back for more insightful information.