Computer Science (Python) > computational-thinking-and-programming-2 > Data File Handling
Write a Python function that displays all the lines ending with a dot (.) from a text file "Colors.txt". For example, if the file contains: White is a mix of seven colors. What are these seven colors ? VIBGYOR - violet, indigo, blue, green, orange and red. When we mix all these colors we just get one light which is the WHITE light.
Then the output should be : White is a mix of seven colors. VIBGYOR - violet, indigo, blue, green, orange and red.
(Hint: You will have to ignore trailing white spaces to check the last character)
Current Session
Community Stats
Track Your Progress
Sign up to save your practice progress and get personalized insights across all topics.