Tik-MohX
Tik-MohX

Reputation: 3

print a 2d array in python

I trained to write a 2d array and then I dont know how to complete , pls help me here is the code (it's simple) :

family = [
    ['zak','mikle','lion','sonia','Richard'],
    [14 , 12 , 11 , 47 , 48],
    ['moh','pr','el noob','lala','pa'],
    ['deep','lovly','noob','kind','smart'],

],
print(family[1][1])

and here is the problem :

enter image description here

Upvotes: 0

Views: 51

Answers (1)

General Poxter
General Poxter

Reputation: 554

Get rid of the extra comma after the end of your array:

family = [
    ['zak','mikle','lion','sonia','Richard'],
    [14 , 12 , 11 , 47 , 48],
    ['moh','pr','el noob','lala','pa'],
    ['deep','lovly','noob','kind','smart'],

]
print(family[1][1])

Upvotes: 1

Related Questions