This worksheet covers software setup for MCS 260 and number systems.
In general, the MCS 260 worksheet for any week's lab will cover material up to the Monday of that week; for week 1, this means only lecture 1 is included.
Collaboration on worksheets is strongly encouraged.
The main course materials to refer to for this worksheet are:
(Lecture videos are not linked on worksheets, but are also useful to review while working on worksheets. Video links can be found in the course course Blackboard site.)
These instructions assume you'll use a personal computer to do some of your coursework, and that you brought this device to lab with you.
If you are going to use UIC lab computers exclusively, and not do any course work on a personal device, you shouldn't need to install anything. Instead, follow the instructions below but skip the actual install steps, so that they become a series of checks that everything is working and that you know how to run it.
All of the software you need for MCS 260 is free. No purchase is required.
The exact steps depend on the operating system of your computer (Windows, MacOS, Linux), and details can be found in the Getting Started section of the course web page.
For most students, this step either requires no action (recent MacOS) or is as simple as opening the Microsoft Store, finding Python 3.9, and clicking Install (Windows).
We'll do a lot of work in MCS 260 using a text-based interface to your computer, the terminal.
The terminal is an application like any other, and is already installed on your computer. But the name depends on your operating system:
At the end of this step, you should have a window open that displays a small amount of text, and which is waiting for keyboard input.
To do this, you'll need to make the terminal the active window and then type the interpreter command name followed by the Enter key. The interpreter command name could be either
python, and in some cases both will work. Try them in that order.
Success looks something like this:
PS C:\Users\ddumas> python Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
Python 3.9.6 on the second line, which shows that Python 3.9 is running. If you see something like
Python 2.7.18 instead, it means that command opened a much older version of Python that cannot be used in MCS 260. Try the command
At this point your terminal will be "stuck" in Python, which waits for you to type commands. You can tell that you are in Python because the prompt is
>>>. If you needed to exit from Python, you would use the command
exit(), but we'll stay in Python for the next step.
This step assumes you have a terminal running, and Python 3.x is running inside that terminal. You should see a prompt
>>> with the cursor to the right of it.
Type the traditional first Python statement
followed by the Enter key. Be careful to include the quotation marks and parentheses exactly as shown above. If you succeeded, a new line of text should appear that contains simply
At this point, you can exit Python by typing
exit() followed by the Enter key.
Most students entering MCS 260 either won't have a programming editor installed, or else won't have a strong opinion about which one is best. If that applies to you, then you should install our recommended one, Visual Studio Code. It's a free program by Microsoft available from this URL:
Note that Visual Studio Code is very different from Visual Studio. Both are made by Microsoft, but we'll only use the first one.
If you already have a different programming editor installed, and prefer to use that, you may do so. However, we probably can't offer technical support on other editors.
Also, programs like Microsoft Word (on Windows) or Pages (on MacOS) are document editors, not text editors, and they won't work for MCS 260.
Open Visual Studio Code (from the start menu or application launcher) and create a new file. You can use Control-N or select File>New from the menus.
In that file, type the following text:
print("Hello world, this is a script!")
Save the file on the desktop (Control-S or File>Save), giving it the name
hello.py. The extension
.py identifies this file as a collection of Python statements, i.e. a script.
Switch back to the terminal or open it again, as applicable. Change the current working directory to the Desktop. In most terminals, the following command will do that:
Run the script
hello.py that you created in step 6 by typing the command
in the terminal. Success is indicated by
Hello world, this is a script!
appearing after you press Enter.
Note 1: This command needs to run in the terminal, and not in Python itself. If your terminal shows
>>> next to the cursor, it means Python is running and you need to exit. The command
exit() will exit Python and return to the terminal.
Note 2: This simple script will run properly even if you accidentally use the Python 2 interpreter. In the future, however, running scripts related to MCS 260 under Python 2 will create major problems. Thus it is important to make sure you are actually running Python 3. You can edit the script hello.py to add a check, as follows:
import sys print("Hello world, from Python version",sys.version)
This will print a greeting that includes the Python version. For example, on Windows it might show:
Hello world, from Python version 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Run python in the terminal again, to get the
Now, experiment with using it as a calculator. For example, try these commands:
Work out these number conversion problems by hand. This document doesn't provide space to write, so use a separate sheet of paper, a blank page in your tablet's writing application, etc.. If you can figure out a way to check them with a calculator or with Python, do so afterward, but this isn't required.
The purpose of working a few conversions by hand is to make sure you understand the basic principles of different number systems.