Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+7 votes

I am not sure how to use the convert function to convert a '.gif' to a '.art' file and can't find anything online or in the book. Can someone help me out?

asked in CSC201 Spring 2021 by (8 points)

2 Answers

+3 votes

I just basically change the filename. I used string slice to remove the .gif extension then add .art to the string.

answered by (8 points)
+2 votes

You are supposed to write the convert function, not use it.

Googling is rarely useful for this class. In terms of the textbook, look for the sections about writing to a text file, because the .art file is really just a plain text file written in a specific format.

In terms of figuring out how to get the file name (which is just a string of text) to end in .art instead of .gif, Thu's answer is good.

answered by (15.6k points)