By default, the system assigns courses, collective and individual, a progressive random numerical code to identify it along with the name.
In case you need to assign a specific code manually, without the system taking care of it randomly, you will be able to enable this possibility.
Navigate to Configuration → Settings → Course-related settings and value the checkbox "Allow/request manual setting of course code"; click the green button at the bottom "Apply Changes" to conclude the operation.
So now, after enabling the above function, for group courses it will be possible to manually assign a code directly when creating the course.
For individual courses, on the other hand, since it is necessary to go through the student's enrollment to create it, the system will assign a random course code, which can be changed by entering the course's edit tab.