Computer Science, asked by neeraj559145, 5 months ago

What get printed ?

names = [‘Hasan’, ‘Balwant’,’Sean’,’Dia’]

print (name [-1][-1])

i. H ii. iii. Hasan iv. None​

Answers

Answered by allysia
2

Answer:

NONE.

Explanation:

In Co de,

\\\tt na mes = ['Hasan', 'Balwant','Sean', 'Dia' ] \\\tt print (na me [-1][-1])

"name isn't defined", "names is" so there's gonna be an error.

Correction:

\\\tt na mes = ['Hasan', 'Balwant','Sean', 'Dia' ] \\\tt print (na mes [-1][-1])

Output: 'a'

Explanation:

  • names[-1] selects last element of list
  • names [-1][-1] will return last letter of the last element.

Similar questions