Get the output | R Interview Question | Zomato
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answer ( 1 )
Solution in Python:
TDM = [‘The’,’Data’,’Monk’] #List
#to display the last element
print(TDM[2])
Output: ‘Monk’
#to change the last element to Monkey
TDM[2] = ‘Monkey’
Output: [‘The’, ‘Data’, ‘Monkey’]
#to remove Monkey from the list
TDM.remove(‘Monkey’)
Output: [‘The’, ‘Data’]
#to get Monk back to the list
TDM.append(‘Monk’)
print(TDM)
Output: [‘The’, ‘Data’, ‘Monk’]