CS 110 Programming Fundamentals - Unit 1 - All Assignments Instructions
CS 110 Programming Fundamentals - Unit 1 - All Assignments Instructions
Overview
Topics:
Learning Objectives:
By the end of this Unit, you will be able to:
Tasks:
A computer programming language is no exception to this rule. Each programming language has
structure, grammar, and vocabulary that must be combined to accomplish the goal of the program.
In the spoken or written language, if we don’t use structure, grammar, or vocabulary properly then
we risk not getting our message across. In a computer programming language, if we don’t use these
elements properly then we run the risk that our program will not function as we expect it to, or it will
not function at all.
In each subsequent unit of this course, we will be learning about the structure, grammar, and
vocabulary of the Python programming language. Python is an interpreted language that is object-
oriented. Python is actually a relatively recent language in that it was first developed in 1991. Other
programming languages, such as Fortran, are much older. Fortran was developed by IBM in 1958.
The BASIC programming language was developed in 1964 and Cobol was developed in 1959.
One item that is a part of this history is origin of the concept of a computer bug. As you will learn in
this unit, a computer bug is a defect in coding of a software program that makes the program
operate incorrectly or fail. The process of eliminating problems or errors in a program is known as
‘debugging’.
Reading Assignment
Downey, A. (2015). Think Python: How to think like a computer scientist. Green Tea Press. This
book is licensed under Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC
3.0). Download the pdf.
Video Resources
mybringback. (2013, November 15). Learn Python programming tutorial 1 | Installing Python. [Video].
YouTube. http://www.pitt.edu/~naraehan/python2/tutorial1.html or from
Discussion Assignment
Programming languages like Python are formal languages with strict syntax rules. But those rules
can change over time with newer versions of the programming language. Your textbook covers
Python 3, but you may only have access to Python 2.
Download and install a working Python environment, preferably Python 3, or get an account with the
Virtual Computer Lab or PythonAnywhere. Refer to the Software Requirements/Installation section
of the course syllabus for details.
Type the statements below into your Python interpreter. For each statement, copy the output into
your Discussion Assignment and explain the output. Compare it with any similar examples in the
textbook, and describe what it means about your version of Python.
When you reply to your peers’ submissions, compare their results with yours.
Learning Journal
Part 1:
Exercise 1.1 from your textbook recommends that you try to make mistakes when experimenting
with a new programming feature.
This kind of experiment helps you remember what you read; it also helps when you are
programming because you get to know what the error messages mean. It is better to make mistakes
now and on purpose than later and accidentally. (Downey, 2015, 7)
For this Learning Journal, first, answer the following questions based on Exercise 1.1. Include
example Python code and output with your answers.
If you are trying to print a string, what happens if you leave out one of the quotation marks or
both and why?
You can use a minus sign to make a negative number like -2. What happens for each of the
following and why?
>>> 2++2
>>> 2--2
>>> 2+-2
>>> 2-+2
In math notation, leading zeros are OK, as in 02. What happens if you try this in Python and
why?
What happens if you have two values with no operator and a space in between them and
why?
Part 2:
Next, describe at least three additional Python experiments that you tried while learning Chapter 1.
Show the Python inputs and their outputs, and explain what you learned from the results of each
example.
References
Downey, A. (2015). Think Python: How to think like a computer scientist. Green Tree Press.
Self-Quiz
The Self-Quiz gives you an opportunity to self-assess your knowledge of what you have learned so
far.
The results of the Self-Quiz do not count towards your final grade, but the quiz is an important part of
the University’s learning process and it is expected that you will take it to ensure understanding of
the materials presented. Reviewing and analyzing your results will help you perform better on future
Graded Quizzes and the Final Exam.
Please access the Self-Quiz on the main course homepage; it will be listed inside the Unit.