Let Friends = [ ’John’, ’Jane’, ’Mike’, ’Mika’, ’Neil’, ’Neela’]. Write a one-line expression which replaces ’Mike’ by ’Matt’ in the list Friends.
use matcha is possible
The answer to this question is as follows:
The code is as follows:
Friends=['John','Jane','Mike','Mika','Neil','Neela']
Friends[Friends.index('Mike')] = 'Matt'
print(Friends)
The input and output are provided in the screenshot below:
Get Answers For Free
Most questions answered within 1 hours.