Question: CSC A08 TERM TEST #1 Question 5. 5 MARKSs] Please write the code for the following function: def total_comments(file_name): (file) -> int file_name: String file_name

 CSC A08 TERM TEST #1 Question 5. 5 MARKSs] Please write

CSC A08 TERM TEST #1 Question 5. 5 MARKSs] Please write the code for the following function: def total_comments(file_name): (file) -> int file_name: String file_name return: the number of lines in file-name containing at least one # comment Example: If file called "song.txt" contains the following: This is the song that never ends # Yes it goes on and on my friends Some people started singing it # Not know what it was # said Ilir And they'll continue singing it forever just because... Then total-comments("song . txt") -2 >>> total.comments ("song.txt") 2 # Your code goes here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!