def display_vowel_words():
vowels = "AEIOUaeiou"
result = []
with open("Report.txt", "r") as f:
for line in f:
words = line.split()
for word in words:
clean_word = word.strip(".,?!")
if clean_word and clean_word[0] in vowels and clean_word[-1] in vowels:
result.append(clean_word)
print(" ".join(result))
This function first defines a string vowels containing all vowels.
PASSENGERS.DAT stores the records of passengers using the following structure:Create() – to input data for passengers and write it in the binary file PASSENGERS.DAT.SearchDestn(D) – to read contents from the file PASSENGERS.DAT and display the details of those Passengers whose DESTN matches with the value of D.UpdateFare() – to increase the fare of all passengers by 5% and rewrite the updated records into the file PASSENGERS.DAT.