Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

no secret done even if all 14 basic tests are ok

c
centuorifederico (230 points)
1 2 3
in HW4 by (230 points)
recategorized by
Hi,

after the peer assessment I've uploaded an improved version of my code that passes all the 14 basics tests, but for some reason my code is not tested on secret tests...
There is something I'm missing?
111 views

1 Answer

Grace (3270 points)
0 0 4
by (3.3k points)
Your program might fail the secret tests because there could be issues with file path construction and directory creation. Try using os.makedirs with the "exist_ok=True" parameter to make directories and subdirectories. The secret tests destination directory has a "\" (slash), so just using os.mkdir isn't sufficient.
andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
Slash is '/'            .

use os.makedirs with exist_ok=True  to create the full path  destination_dir + '/' + song dir

os.mkdir is forbidden