Part A Write a function which: is named read_file_contents takes a string pathname as an argument returns a single strin
Posted: Thu Jul 14, 2022 2:19 pm
Part A Write a function which: is named read_file_contents takesa string pathname as an argument returns a single string thatcontains all the contents of the file Don't import any additionalpackages. If I have a file random_text.txt, I'll give the full pathto this file to the function: contents =read_file_contents("random_text.txt"), and I should get back asingle string contents that contains all the contents of the file.NOTE: Your function should be able to handle errors gracefully! Ifan error occurs when trying to read from the file, your functionshould return None (note the capitalization of the firstletter).