Please note that some links on the course syllabus page are only accessible to registered students.
Hello! Welcome to ENGR 103 - Computational Thinking via Tinkering in Python. Computer science is a fascinating field, full of interesting problems to work on, and it certainly doesn't hurt that computing skills are in high demand. Whatever your particular set of motivations for taking this course, it is our hope that you will gain the knowledge and skills that will help you reach your goals.
NOTE: Some links on this page may only be accessible to registered students.
Instructor: Doshna Umma Reddy
Teaching & Learning Assistants: Azad Dazaea, Brittaney Davis, Chelsea Li, Matthew Callahan
We are a community of learners. Connect with fellow students, the learning assistants, and the instructor via the communication tools for the course. Our primary communication tools are Ed Discussions (for course and assignment questions), Teams (scheduled live help sessions) and, if necessary, email.
Communications over the weekend will not be responded to until Monday.
Instructor Contact Information
Instructor: Doshna Umma Reddy
Email: firstname.lastname@example.org Please put the prefix [ENGR 103] in the subject when you send an email regarding this course.
Help Hours Details and TA contact info: on this page in the Start Here module
Students in this section may be required to interact with teachers, teaching assistants, and
students in other concurrent sections of this same course.
Required textbook: None
Canvas is the LMS (Learning Management System) that you are using right now to view this course. For questions about Canvas, check this list of help topics.
Repl.it is the tool that was used to create the interactive exercises in the lessons. The exercises are embedded in the lesson pages in Canvas, but you will need to be logged into Repl.it in order to view them. Hey, sign up for your free repli.it account now!
The first time you view an Exploration page, you might see Captchas on all of the Repls. These are a security device which try to determine whether you are a human or robot by giving you a small puzzle that relies on human reasoning skills like abstraction. The most common is a grid of images and a prompt such as "Click on all images which contain a truck". You can get rid of these by solving the Captchas.
You can execute the sample programs by clicking the "play" button or on the green arrow "run" button near the top. When you do this, you should see the results or output of the program.
But you should look at the code! Click "Show files" and select the .py file in the sidebar to see the code.
Important: you should experiment or "tinker" with the code! Replit used to allow us to let you edit things right there in the window, but they no longer provide this service due to abuse. So you have to do two steps:
- Click the Open on Replit button in the upper right.
- In the new screen that appears, click the Fork Repl button in the upper right. This creates a personal copy of the programming environment for you to edit and experiment with.
If you get stuck or break something, that is ok! Post a question using our communication tools.
At the bottom of each assignment page is a link to Gradescope, which will open in a new tab. On Gradescope you'll be able to click a link to submit your projects from GitHub.
Note: Scores in Gradescope are only one part of the assignment grade, and only represent the number of tests passed.
Ed Discussions and Teams
Use the Ed Discussion link in the sidebar for official course discussions, assignment questions, etc.
Teams is a forum for more informal interaction with your fellow students. It is also where TAs and the Instructors will hold office hours.
You can download and install the desktop or mobile app from here or also use it from the browser.
Connecting to our class teams:
- Click on Microsoft Teams link in the left navigation on canvas. You should be automatically added to the Class team.
PyCharm is the IDE (Integrated Development Environment) that you will use in this course to develop your assignments. There are a few steps you'll need to follow to get PyCharm set up on your computer:
- Download and install the current version of Python 3, found here.
- Download and install the Community edition of PyCharm, found here.
- Run PyCharm and answer the setup questions (accept the default if you aren't sure). You should reach the welcome screen, which looks like this (except you won't have any projects yet):
- On the welcome screen, click on "New Project". You should now see this screen (your Python interpreter may not match yet):
- In the "Location" path, replace "pythonProject" with "greeting". This will be the name of your project.
- Uncheck "Create a main.py welcome script".
- Next click on the little arrow to the left of "Python Interpreter". You should now see something like this:
- Click on "Previously configured interpreter" and select whatever version of Python 3 you installed. PyCharm will remember this choice as the default for future projects (which is good, since Python 3 is what we'll use throughout the course). [If the Python 3 interpreter you installed doesn't appear, open the Settings/Preferences dialog, select Python Interpreter, click the icon and select Add. Next select System Interpreter and then select your installation of Python 3.] Next click "Create". You should now see this screen:
- Near the top of the left pane, right-click on the project folder ("greeting"), select "New/Python File", and name the new file "greeting.py". In your new document, type the following: print("Hello world.")
- Right-click anywhere on the document and select "Run 'greeting'" (which has a little green triangle icon to its left). This should make "Hello world." print to the output window. Congratulations - you've just created and run a program in Python!
- Click on "Python Console" at the bottom left of your screen. This changes the bottom window from an output window to a console window, where you can use Python commands interactively. Try entering in this window the same print command that you put in your program. Interactive mode is handy for trying out simple things quickly, but for more complex things it's easier to write a program (or "script" as they're often called in interpreted languages such as Python). If you run your program again, the bottom window will switch back to showing the output of your program.
These instructions showed you how to create a project in PyCharm from scratch, however for the assignments in this course, you'll be creating projects in PyCharm from cloned GitHub repositories. That process will be explained below.
GitHub is a popular web hosting service for Git repositories. Git is a distributed version control system that makes it easy to keep backups of different versions of your code and track changes that are made to it. You'll be using GitHub to host your assignment code. The assignment page in Canvas will contain a GitHub invitation link for each coding project. When you accept that invitation, GitHub will create a repository for you for that project. Your project's repository contains all of your project's files and stores each file's revision history. You can clone these repositories and then commit and push updates to them from within PyCharm. Cloning a repository creates a local copy of it. Committing a change updates your local copy. Pushing a change updates your repository on GitHub.
To do a project, you'll first clone it from a URL given on an Assignment page. Cloning a project creates your own private repository (or repo) for the project on your GitHub account. GitHub is a popular web hosting service for Git repositories. When you commit and push your code, it stores a backup of the current version both locally on your computer and in your repository for that project on GitHub. If you look in your account on GitHub, you should be able to verify that your repository was updated.
After cloning a project to your GitHub repo, you'll create a PyCharm project on your computer where you can do your coding. You'll do this by telling PyCharm the URL of your GitHub repo for that project.
You can commit and push your code as often as you feel is useful, but you'll at least want to commit and push when you finish and your code is ready to submit. You submit your code on Gradescope, and it's pulled from your GitHub repo, which is why you want to make sure you commit and push to GitHub before submitting on Gradescope.
- Download and install Git.
- In the Settings/Preferences dialog of PyCharm, select Version Control | Git in the left pane and specify the path to the Git executable.
Use PyCharm to clone your repository from GitHub:
- From the welcome screen, choose Get from VCS (you can always get back to the welcome screen by closing your project window). You should now see a dialog that has "Git" selected for "Version control", and has an empty field for URL, which is where you will copy the assignment repository URL that GitHub gives you (when you click on a project link from the Assignment pages). When you do that, the directory field will be filled in automatically. Then click on "Clone".
- The first time you do this, you'll get a dialog that says "Log in to GitHub". Click on "Use Token...", and in the next dialog, click the "Generate..." button next to the Token field. This will take you to a "New personal access token" page. Select a Custom Expiration date that is one year away. Then, scroll down and click "Generate token". You should now see a page with your personal access token, which you will copy-paste into the "Token" field of the dialog. Now click "Log in".
- You should now be in a new PyCharm project based on the sources you cloned from GitHub. Now you can read the specifications in the readme file, add a new file to the project with the specified name, and get coding! When you add new files to the project, PyCharm will ask if you want to add the file to Git, which you do, so you'll click "Add". This allows you to backup that file using Git and GitHub.
Use PyCharm to commit and push changes:
- To commit and push changes to GitHub, click on the toolbar (in the upper right). This will bring up the Commit Changes dialog. To commit and push changes to GitHub, on Mac click Mac git commit icon on the toolbar in the upper right, or on Windows click the Windows git commit icon in the vertical toolbar on the left. This will bring up the Commit Changes dialog.
- There should be a pane that shows the name of your .py file, with a checked box in front of it. This shows that that file will be included in the commit and push. There may be another box that says "Unversioned Files" next to it. This box should be unchecked, so that you aren't backing up a bunch of PyCharm project configuration files to your GitHub account.
- There should be another pane titled "Commit Message". Enter a commit message. A good commit message should be a brief summary of what has changed since the last commit. You won't be graded on your commit messages, but if you need to roll back to a particular version of your code, good commit messages will help you find the one you're after. This will be especially important on the job, when working on large projects with many people.
- From the Commit drop-down selection (in the lower right) choose "Commit and Push". Then in the pane that pops up, confirm the Push. Make sure that you commit and push. If you just commit, that will only update your local copy of the repository, not the copy on GitHub. The push is what updates the copy on GitHub.
(optional) Calling scripts from the interactive Python console in PyCharm
In the interactive exercises in the exploration pages, it's possible to call parts of a Python program (sometimes called a "script") directly from the interactive console. However in PyCharm the default settings don't allow you to do this. You don't need to be able to do that for this course, but if you would like to replicate that behavior in PyCharm, here's how.
In PyCharm, go to Run > Edit Configurations... > Check "Run with Python Console":
Now you should be able to call parts of a Python program from the interactive Python console in PyCharm. One possible use of this is to write the program for your assignment and instead of writing test code in the same file (which you would need to delete before submitting), you could test the program by calling your code from the interactive console.
Click on "Python Console" at the bottom left of your screen. This changes the bottom window from an output window to a console window, where you can use Python commands interactively. Try entering in this window the statement
and hit <enter>. Interactive mode is handy for trying out simple things quickly, but for more complex things it's easier to write a program (or "script" as they're often called in interpreted languages such as Python).
If you run your animal.py file again, the bottom window will switch back to showing the output of your program.
- Go to the Assignment 1 page and click on the URL for Project 1 (most assignments will have more than one project). When you accept the invitation, it will clone the project and give you the URL of your new project repository. Copy that URL.
- Follow the steps listed above to complete assignment 1 setup on Pycharm. Copied URL refers to 'assignment repository URL'.
Use Gradescope to submit your code
Open Gradescope (using either the link in the left sidebar or the one in the Assignment page), click on Project 1, and then click on "Upload Submission". You'll be asked to connect to your account and select a repository. You'll also be asked for a "Branch", for which you'll just select "main". When you finish making your submission, Gradescope will automatically run a few tests and give you some feedback which should let you know whether you submitted it correctly or not. There are "hidden" tests that you won't see the results of until after the late due date, so be sure to test your code yourself to make sure it works correctly.