From the "Files" view in a CoCalc project, the "Filename" box
lets you create files by either
- typing a file name in the "Filename" box and hitting ENTER,
- clicking the "+ New" button and selecting a file type.
Among other file types, you can create
- a CoCalc worksheet (if you input a name ending in
.sagews) - a Jupyter notebook (file ending in
.ipynb) - a code file (file ending in
.py, or .sage, or many other extensions)
You can also open a terminal (type a name ending in .term and hit enter).
If you don't specify a file type, you get a CoCalc worksheet.
You can of course type the content of your Sage program in a .sage file,
say experiment.sage, then run that program by opening a CoCalc terminal,
typing
sage experiment.sage
and hitting enter.