Computer Science, asked by ng77998, 4 hours ago

Find the output-
→→→A=[67,21,'hello' ,' brother']
→→→A.remove('hello')
→→→print(A[-3])​

Answers

Answered by Learnfun21
0

Answer: The answer would be 67.

Explanation: Since you are coding in python. The A.remove('hello') pops out the string hello from the stored value of A in line 1.

Now, the command print(A[-3]) counts the remaining stored data from backwards:   [67, 21, 'brother']. Hence, 67 is the solution.

Answered by anindyaadhikari13
1

Answer.

Given Co​de:

A=[67,21,'hello' ,' brother']

A.remove('hello')

print(A[-3])

Output:

> 67

Explanation:

Here, we are given with a list of four values:

\tt A=\boxed{\begin{array}{c|c|c|c}\tt67&\tt21&\tt 'hello'&\tt 'brother'\end{array}}

The list.remove() method is used to remove element from a list if it is present.

> A.remove('hello') - Removes 'hello' from the list.

\tt A=\boxed{\begin{array}{c|c|c}\tt67&\tt21&\tt 'brother'\end{array}}

> print(A[-3]) - Prints the third element from the end of list (Negative indexing)

>> 67

So, the output is - 67.

Similar questions