Find the output-
→→→A=[67,21,'hello' ,' brother']
→→→A.remove('hello')
→→→print(A[-3])
Answers
Answered by
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
1
Answer.
Given Code:
A=[67,21,'hello' ,' brother']
A.remove('hello')
print(A[-3])
Output:
> 67
Explanation:
Here, we are given with a list of four values:
The list.remove() method is used to remove element from a list if it is present.
> A.remove('hello') - Removes 'hello' from the list.
> print(A[-3]) - Prints the third element from the end of list (Negative indexing)
>> 67
So, the output is - 67.
Similar questions