In a make task you write the program yourself, from an empty editor.
A local restaurant wants a simple program to save customer feedback ratings into a text file.
Write a program that:
int(),feedback.txt in write mode ("w"),Feedback saved.The file holds only the most recent rating. If feedback.txt already holds
older feedback, that is replaced, not added to.
The tests also check your code: use int() to read the rating.
The two questions come first, in this order and worded exactly like this:
Enter your name
Enter your rating out of 10
Then one last line, once the file has been written and closed:
Feedback saved
feedback.txt holds one line, where NAME is the name the user typed and
RATING the rating:
NAME - RATING
There is a space on either side of the hyphen. The line may end with a "\n"
or not: with only one line in the file, either is fine.
Input:
Sam
8
Output:
Enter your name
Enter your rating out of 10
Feedback saved
feedback.txt afterwards:
Sam - 8
Ask each question with its own print, and read the answer with a bare
input() on the next line, rather than passing the question to input(...).
The questions are part of the output that is checked here, so their spelling,
capital letters and punctuation count. So does the line in the file.
Make sure that you check for the following things:
feedback.txt, spelled exactly like that."w", so old feedback is wiped. With "a", a file that already
holds a rating ends up with two.str() before it is joined onto the name. write
only takes text." - ".Feedback saved is printed.