Test Index
CBSE Class 12 Computer Science 2023 Paper Compartment
© examsnet.com
Question : 27 of 35
Marks:
+1,
-0
(a) Write a function in Python that displays the book names having ‘Y’ or ‘y’ in their name from a text file “Bookname.txt”.Example :If the file ‘Bookname.txt’ contains the names of following books :One Hundred Years of SolitudeThe Diary of a Young GirlOn the RoadAfter execution, the output will be :One Hundred Years of SolitudeThe Diary of a Young GirlOR(b) Write a function
RevString() to read a textfile “Input.txt” and prints the words starting with ‘O’ in reverse order. The rest of the content is displayed normally.Example :If content in the text file is :UBUNTU IS AN OPEN SOURCE OPERATING SYSTEMOutput will be :UBUNTU IS AN NEPO SOURCE GNITAREPO SYSTEM(words ‘OPEN’ and ‘OPERATING’ are displayed in reverse order)
Go to Question: