This program is written in Python and it performs the following operations:
val = ['P', 'Y', 'T', 'H', 'O', 'N'] print("The original list : " + str(val)) res = [i if i == 'T' else '@' for i in val] print("List after replacement : " + str(res))
The original list : ['P', 'Y', 'T', 'H', 'O', 'N'] List after replacement : ['@', '@', 'T', '@', '@', '@']
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions