I have a nested list, and I'm trying to capitalize all the titles (the third element in each nested list i.e. cardinal richelieu etc.).
Can't seem to wrap my head around the right approach. I thought replace would work, but I'm getting an error: TypeError: replace() argument 2 must be str, not builtin_function_or_method
Below - nested lists, followed by my attempt at replace. I appreciate any help to understand what I'm doing wrong!
[['j234hg', '19 October 1969', 'court scene with cardinal richelieu'], ['d45j5jkd', '28 December 1969', 'THE ROYAL PHILHARMONIC ORCHESTRA GOES TO THE BATHROOM'], ['s4k5jk', '8 December 1970', 'crossing the atlantic on a tricycle'], ['zd7u4h', '19 October 1969', 'Bicycle Repair Man'], ['f983', '22 December 1970', 'Royal Episode 13 (or: The Queen Will Be Watching)'], ['j8s74', '15 September 1970', 'THE SEMAPHORE VERSION OF WUTHERING HEIGHTS'], ['n4j6l3j', '7 December 1972', 'Mr. Pither']]
records_list = [[x.replace(i[2], i[2].title) for x in i] for i in records_list]