Course Scheduling Announcements and Python Programming - Getting Started: Difference between pages

From Computer Science at Indiana State University
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
This page contains announcements of changes from the normal scheduling of courses.
''This page is part of [[Programming and CS - Getting Started]]''


Note that when a course substitution needs to be made because a regularly offered course is not offered, you should choose a CS course that is at the same or higher level.
For a video explaining how to get started here, see https://www.youtube.com/watch?v=uLnhcCZS4-Y&t=424s


=2026-2027 Academic Year=
==Getting Started==
* 8/14/2026 - CS 479/579 is normally offered in the fall but is being cancelled for this fall (due to a staffing shortage and low enrollment in the course).
# '''Reading''' - start reading through at least one of the following before you start working on the programming problems.
* 8/14/2026 - Students who need to take CS 331 this term should take ECT 301 instead. They are very similar courses, and MySAM will be fixed so that it shows ECT 301 as completing the requirement.
## [https://www.w3schools.com/python/python_intro.asp w3schools Python] - interactive tutorial where you can try out code in the browser
* 8/14/2026 - AI 602 is being moved to the second 8 weeks of the semester.
## [https://www.learnpython.org/ Learn Python] - interactive tutorial where you can try out code in the browser
* 8/3/2026 - Students were informed earlier in the spring that once again CS 210 is not being offered, and that students who need it should register for ECT 373 instead.
## [https://automatetheboringstuff.com/ Automate the Boring Stuff with Python] - suitable for people with very limited programming experience, this is the text that is being followed for our CS 151 course (as of 2019)
* 5/14/2026 - CS faculty and courses will remain in Root Hall for fall 2026, and will be moving back to TC for spring 2027.
## [http://greenteapress.com/thinkpython2/html/index.html Think Python] - suitable for people with very limited programming experience, not very deep
* 5/14/2026 - CS 600 is being added to the schedule so new CS MS students can take it. New CS MS students should take CS 600, CS 501 (if they haven't taken CS 401 already), and pick between AI 601, AI 602, or another CS 500/600 level course they are prepared for.
## [https://learnxinyminutes.com/docs/python3/ LearnXinYminutes] - quick review once you are familiar with the basics
* 5/14/2026 - Two new courses will be offered in the fall, AI 601 Ethics of AI, and AI 602 Prompt Engineering Theory and Application. These have no prereqs and are intended for a general audience. CS student can take them and have them count as electives. See the schedule of classes for more details.
## [https://docs.python.org/3/tutorial/ Python.org tutorial] - good for those with programming experience already
* 5/14/2026 - CS 617 will not be offered in the fall. Students who need it should register for AI 601 or AI 602 instead. TBD when CS 617 will be offered again.
# '''Get Python installed on your computer''' - download the latest Python3 version at https://www.python.org/downloads/.  Having python3 installed on your computer allows you to debug much quicker.
# '''Work on solving problems''' that are listed below.
# If you are a current or incoming ISU student, or an ISU alumni, get help on what you are working on using the online unix lab. When asking about the hackerrank problems make sure to refer to them using the title hackerrank gives them, or give a link to the problem statement on hackerrank.
# '''Cheat sheets''' - keep a cheat sheet for yourself of python syntax, built-in functions, etc. See below on this page for our model cheat sheets.


=2025-2026 Academic Year=
==Running Python==
* 11/30/2025 - CS courses and faculty are moving temporarily to Root Hall for spring and summer 2026. The third floor of TC is getting renovated. CS faculty updated room numbers are at [[ISU CS People]].
''See [https://youtu.be/ABmQ2QyYCLg this video] for a video demo of getting started running Python on the CS server and in IDLE.''
* 11/12/2025 - CS 401, 456, 457, 458 - these all have lab sections that go with them. The prerequisites were updated for the lecture course but were not properly updated for the lab sections. If you are able to register for the lecture course but get a prereq error for the lab course (e.g., you can register for CS 401 but get a prereq error for CS 401L) we will do a prereq override to allow you to register for the lab. You can notify either myself or Emily Miller (if she is one of your advisors), and we will request a prereq override for you.
* 6/24/2025 - the CS MS is getting updated for the start of the 2026-2027 academic year. Starting in Fall 2026, concentrations will no longer be required. The program requirements will be: Core Courses (9 credit hours - CS 500, CS 501, and CS 600), Culminating experience (3 credit hours - CS 685, CS 695, or CS 699), CS electives (12 credit hours), general elective (3 credit hours in CS, ECT, MATH, BIO, or PHYS). Students will be able to choose electives from their interests, and we will continue to offer courses from across CS, data science, bioinformatics, etc. The total # of credit hours required will be 30 (is 33 currently), and at least 15 credit hours need to be 600 level.
* 6/2/2025 - CS 210 is being replaced with ECT 373 for the fall term. The content is similar, and ECT 373 will count in place of CS 210. CS BS students in the information science concentration should register for ECT 373 rather than CS 210.
* 6/2/2025 - CS 500 and CS 600 are being canceled for the fall term. These are normally for new CS MS students. New CS MS students will take CS 501 and choose two other 500/600 level courses. CS faculty will discuss and let you know which ones.
* 6/2/2025 - CS 602 is being canceled for the fall term. ECT 636 is similar, so students interested in the content should register for ECT 636 instead (and it will count towards the CS MS).
* 4/4/2025 - Going forward, for CS online courses where there is also a face to face section, we will only allow distance students to register for the distance section. Individual instructors can choose how flexible to be with attendance in these cases, but this makes it so that face to face students are required to take exams and quizzes in person (which we need to help prevent cheating).
* 4/4/2025 - For those taking ECT 437 (which is replacing CS 499) in the fall, you should register for one of the sections that has Jeff Kinne as instructor.
* 3/12/2025 - ECT 437 and ECT 438 - note that ECT 437 is offered only in the fall, and ECT 438 is offered only in the spring. For those who graduate in a spring term, you will take ECT 437 in your last fall and ECT 438 in your last spring. For those who graduate in a fall term, you will take ECT 437 in your second last fall, and ECT 438 in your last spring. For 2025-2026, the following should take ECT 437 in the fall: anyone graduating in spring 2026 or in fall 2026.
* 3/12/2025 - ECT 437 and ECT 438 are replacing CS 499 for all CS students starting in the fall. Students that started in Fall 2024 or later already had ECT 437 and ECT 438 in their MySAM. Remaining students that still needed to take CS 499 in the fall or spring have now had their MySAM updated to require ECT 437 and ECT 438 instead. Those who needed one more term of CS 499 will take ECT 437 in the fall. Those who needed two terms will take ECT 437 in the fall and ECT 438 in spring 2026.


=2024-2025 Academic Year=
Once you have a computer with Python installed you are ready to try it out!  You can use the CS systems (computers in our classrooms and labs, or connect to the CS server - see [[Linux - System Setup]]), or install Python on your personal computer. ''We recommend doing both.''
* 8/18/2024 - Even though many CS courses still have TBA for instructor, they will all run. Faculty have been hired to teach them, they are just in the process of being added. We will also have one of the tenured faculty added to each of these courses, so you have someone to communicate with in the meantime. That should be setup by the end of the first day of classes.
* 8/13/2024 - For undergrad students in the information science concentration, three of the courses that are required might show up as CS or CSS in your MySAM. These are CS 210, CS 211, and CS 331. If these show up in your MySAM as CSS, then taking the CS version will not make MySAM happy, and we'll put in a substitution for them. So, take the CS version of the course, and let your advisor know that you'll need a substitution.
* 8/9/2024 - The following courses have been changed to be offered during the second 8 weeks of the fall term - CS 401&L, CS 501, CS 602, CS 617.
* 8/1/2024 - Most CS courses for the coming year will have a face to face section and an online asynchronous section. If the online asynch section is taught by the same faculty member as the face to face section, it is very likely that the faculty member will have the face to face section available to join online synchronously and will record these for those who don't join live. This is the way most CS courses have been running, but now the online section will not have an official meeting time listed. Each faculty member can decide how they want to handle this.


=2023-2024 Academic Year=
===Run in the Terminal===
* CS 600 will be offered every term (previously was fall only) so new CS MS students can take it their first term, including for those entering in the spring.
On the CS server, other Linux systems, and macOS, you can run python using your terminal. If you run the command <code>python3</code> then you will see the python console. Here you can type one python line at a time to run, and the results are displayed. You can try these -
* 12/14/2023 - students in the information science concentration, for the courses CS/CSS 210, 211, 331 - make sure to register for the one that shows in your MySAM. They are cross-listed, so it is the same either way, but you need to register for whichever is listed in your MySAM (CSS 211 if it says that, CS 211 if it says that).
<pre>
* 11/28/2023 - CS 302 will not be offered in the spring anymore. Students who need to take courses in the fall that require CS 302 as a prereq will be granted prereq overrides to take those courses concurrently. Students taking courses in spring 2025 will not need prereq overrides because they can take CS 302 in the fall.
2 + 3
* Pending potential changes to the CS major (for students who start in 2024)... Count CS 210/211/331 or CSS 210/211/331 for information science concentration (either one would be fine). To get ready to move CS to the ECET department: information science concentration - CS 101 no longer required, replace CS/CSS 331 with ECT 301; all concentrations - drop CS 499, add ECT 130, 430, 437, 438.
3 * 4
* 9/25/2023 - 4+1 accelerated BS+MS program for computer science is now in effect. A student in their third last semester of their BS can apply for the CS MS and take a limited number of graduate courses during their senior year in order to potentially finish the CS MS in an additional year at ISU. See here for more details: https://cs.indstate.edu/info/programs.html
10 ** 3
* 9/22/2023 - for students in the information science concentration, when registering for the courses CS 210/211/331 or CSS 210/211/331 you should register for the one that is listed in your MySAM (for most of you, it lists CSS). If you ended up taking the CS counterpart, notify your advisor so they can submit a petition to have MySAM properly count the CS course.
</pre>
* 8/3/2023 - there will be many students getting prereq errors due to some courses changing numbers. CS 202 has been changed to CS 302 (Data Structures and Algorithms), and CS 303 has been changed to CS 203 (Discrete Math and COmputing Theory). Any courses that have either of those as prereqs may give prereq errors even when you took them. If you think you are getting a prereq error for either of these even though you did take the course (and got a C or higher), let your advisor know which course you are trying to register for (and your id #, as always).


=2022-2023 Academic Year=
We normally store our python code in text files and want to run the entire file. If you have a file with python code (let's say it is named myProgram.py) then you change directories to the directory that has your file, and then type <code>python3 myProgram.py</code>. You can have one terminal open where you are running your program with this command, and you can have another terminal open to edit the file (or use some other text editor).
Dr. Sternfeld is retiring with his last term being Spring 2022. Steve Baker is also leaving ISU. So we will be down from 7 full time CS faculty to 5. We have plans to run a faculty search to replace one or both of them, but for 2022-2023 we need to make do with fewer full time faculty. To make the schedule work we are making the following changes.
* ''Part time lecturers'' - increase the number of courses taught by part time lecturers.  
* ''Canceling a few courses'' - the following courses would normally be offered but will not be for the upcoming academic year - CS 305 Computer Science Teaching Methods, CS 452/552 Software Engineering, CS 619 Trends in Computer Science, CS 658 Algorithms II, CS 671 Operating Systems II. If your concentration requires any of these courses, please consult your advisor to decide on substitutions.


Changes made after the schedule was originally released...
===Run in IDLE===
* 11/13/2022 - '''CS 151 Introduction to Computer Science''' - now has a prereq of B- in CS 101 or passing the CS 151 placement test.  For more, see https://cs.indstate.edu/web/index.php/FAQ#CS_101_versus_CS_151
Python comes with a graphical front-end called IDLE.  You can run this program if you are in the CS labs by opening your terminal and then typing <code>idle3</code>.  If you have python installed on your personal computer, then you can find IDLE in your list of programs (Start button on Windows, Finder then click Applications on macOS) or run idle3 from the terminal (if you are using Linux).  If you are connecting to the CS server with a terminal program from home, you cannot run idle3 in the terminal because it is a graphical program - you will need to install it on your home computer to use it from home.
* 10/28/2022 - '''CS 303 Discrete Math and Computing Theory''' - prereq is being updated to be just CS 151, so CS 303 can be taken along with CS 201 after CS 151.  This will be official for next academic year, and for spring 2023 we will do prereq overrides to allow students to register.  If you want to wait to take CS 303 until when you originally had it planned, that is okay too.
* 9/23/2022 - Due to a staffing shortage this year, we are '''canceling''' the following for the '''spring''' term - '''CS 256 Structured Design''' and '''CS 602 Mobile and Cloud Computing'''.  If you need to take either of these, be in touch with your advisor  to discuss your options.
* 9/23/2022 - Math '''will be offering MATH 503 Linear Algebra and Modeling''' after all in the spring, so data science students who have not taken it should take it. If it is not possible to fit it into your schedule, check with your advisor.
* 8/1/2022 - A course '''CS 510 Fast Track Into to Programming''' has been added to the fall and spring schedule. This is meant for those with little to no previous programming experience, those who want a refresher before taking other CS courses, or those looking to get ready to apply for the CS MS.  See [[CS 510]].
* 5/20/2022 - It appears that the math department will not be offering <del>MATH 503 Linear Algebra and Modeling for Data Science and</del> '''MATH 540 Statistics for Data Science''' during the next academic year. This is required for the data science concentration. If you are completing the data science concentration you should take CS 600 to use this as a replacement for the course.
* 4/11/2022 - Changing '''CS 417 Machine Learning''' to be in the spring rather than the fall. A section of '''CS 459 Topics in CS: Big Data / Data Mining''' is being added to the fall schedule (should show up within a day or so). The prereq for that will be CS 401 and can be used in place of CS 417 if you cannot take CS 417 in the spring; write to the your advisor to ask to be granted an override to register for the course.
* 4/11/2022 - '''CS 473/573 Computer Networks''' in the fall has been changed to be a synchronous online course with meeting day/time of Tuesday 6-8pm.


=2021-2022 Academic Year=
When you start IDLE, it shows you the Python3 console, where you can type your Python3 commands. Try typing in arithmetic expressions to make sure it is working. For example -
''Lab sections'' - New this year, the following courses have required lab sections - CS 401, 456, 457, 458. These are required as co-requisites regardless of what your MySAM says (i.e., your MySAM does not list CS 456L as a requirement, but you need to register for it to take CS 456). These extra lab sections can count as electives of substitutions for those who need 400 level CS credits.  
<pre>
2 + 3
3 * 4
10 ** 3
</pre>


''Credit hours'' - A few courses have had their number of credit hours: CS 303 is not 4 hours, CS 499 is now 2 hours. If your catalog year was for the smaller number of hours, then the additional hour can be counted towards electives or substitutions.
===First Python Program===
We store python programs in text files.  You can use the following as your first python program.
<pre>
print('Hello world.')
print('Hello again.')
print('Goodbye now.')
</pre>
If you are using IDLE you create and run a file by -
# Click on File and then New File. 
# Copy/paste or type your code in the file window that comes up.
# Click File and Save As.  Name the file myProgram.py and save it in whichever directory you want to keep your python programs. 
# Click Run and then Run Module.  In the python console window you should see that your program ran.
If you are connecting to the CS server with your terminal from your home computer, you can choose one of the following options.
* Create and edit the myProgram.py file with a text editor that works in the terminal - see [[Linux Terminal - Text Editors]].  Save the program and run the program with <code>python3 myProgram.py</code>. If you make changes, edit the program, and then run it again.
* Edit the program using a text editor on your home computer (for example, Kate or Atom, see [[Linux Terminal - Text Editors]]), transfer to the CS server using a file transfer program (see [[Linux - System Setup]]), change directories in your terminal to the directory that has the program, and then run the program in the terminal with <code>python3 myProgram.py</code>


''Courses not offered'' - In order to offer required courses in the revised BS and MS programs every year, the following courses will not be offered for the foreseeable future: CS 420/520 Theory of Computation, CS 421/521 Formal Methods. Current students who have this listed as required should consult with your advisor to decide on substitutions. After substitutions are decided, your advisor will submit a petition so the substituted courses will show up in your MySAM (for undergrads) or plan of study (for grads).
===Python2 versus Python3===
If you want to use Python version 2 instead, you would use commands <code>python</code> and <code>idle</code> rather than <code>python3</code> and <code>idle3</code>. You should normally use Python3; the only reason to use Python2 is if you are using a package that is only available on Python2 (Python2 is not officially supported anymore, so this should be fairly rare).


''Courses not offered'' - Due to staffing changes this year, the following courses that are required in the CS MS data science concentration are not being offered: Math 503 Linear Algebra and Modeling for Data Science, Math 540 Statistics for Data Science. Consult your advisor to decide on courses to substitute for these. We expect these courses to be offered again in the next academic year.
==Installing Python on Your Personal Computer==
'''Windows and macOS''' Download and install from https://www.python.org/downloads/.


''Courses online'' - CS programs are now offered completely online. For each required course in any of the CS programs, it will be offered at least once per year online. Most courses are offered in hybrid fashion - a combined section that has face to face students in the classroom, online synchronous students participating via Zoom or Teams, and asynchronous online students watching recordings and scheduling meetings as needed. Some courses are offered with a single asynchronous online section where all students participate asynchronously.
'''Linux''' On Linux python is probably already installed. If not do an internet search for your Linux distribution and "install python3" (i.e., search for - ubuntu install python).


''Help lab online'' - The CS help lab (aka the Unix Lab) is now available completely online. Lab assistants with hours during the day are in the help lab
'''Chromebook''' You should first get the Linux development environment enabled and then you can follow instructions for installing python3 for ubuntu.  If python3 is not already installed, then running the following should do install it.
and also available online. There are normally evening hours that are available online only. For more, see [[Labs and Office Hours]]
<pre>
sudo apt-get update
sudo apt-get install python3
sudo apt-get install idle
</pre>
Once those finish, you start idle by opening the terminal and then typing the idle command.
 
==Lists of Problems==
===Programming Assignments 1===
[[Programming Assignments - Beginning 1]] - start with trying to solve these problems.  Each requires a different feature of the Python programming language, so solve these problems as you read through one of the tutorials or links above. Note that the page includes a link to repl.it that contains solutions to most of the problems.  If you do not have Python installed on your computer, you can try it out at [https://repl.it/ repl.it] - click the logo at the top, then click "+ new repl", select Python and Create Repl.
 
[[Programming Assignments - Beginning 2]] - another set of classic beginning programming exercises.  Some of these will be more involved.
 
===HackerRank Problems===
Once you can do some basic Python programming it is time to have some of your work checked.  Hackerrank is a site where you can create an account and work on problems that will be checked if they are correct. Note that hackerrank has very strict rules for accepting correct solutions.  Start with the basic problems to get a feel for what hackerrank expects.
 
[[Python programming - hackerrank problems]]
 
===More Practice===
If you are able to do most of the problems on the pages linked above, then you don't need us to give you lists of problems any more.  You can pick problems to work through on your own. Some suggested places with problems are as follows.
* [https://www.hackerrank.com/domains/algorithms Hackerrank - algorithms]
* [https://www.hackerrank.com/domains/data-structures Hackerrank - data structures]
* [http://cs.indstate.edu/acm/contests.html ACM Contest Problems]
 
==Cheat Sheets and Quizzes==
These cheat sheets have the highlights of some of the basic information to memorize when you are in your first year of Python programming.  Note - each cheat sheet contains a sample quiz that might be used by your instructor.
* [[Cheat sheet - Python Operators, Expressions]]
* [[Cheat sheet - Python Keywords, Concepts, Functions]]
 
==Programming Errors and How to Fix Them==
* '''Syntax error''' - program is not a valid program, and normally python gives you an error message giving some indication of what the problem was.
** ''Debugging'' - read the error message!  Normally you are given a line number where python got "confused" - sometimes that is where the problem is, but you may need to look just before that line (or just after).  Common syntax errors in python...
** ''Mismatched'' () or [] or "" or '', for example <code>x = 2 * (3 + 4</code>
** ''Mis-capitalization or mis-spelling'', for example <code>Print('hello')</code>
** ''Improper indenting'', for example
** ''Data type'' problems - mixing up strings and numbers, for example <code>x = '3' + 4</code>
<pre>
for i in range(0, 10):
print(i)
</pre>
* '''Runtime error''' - program is a valid program but when you run it something goes wrong.  Debugging is similar as for syntax errors and logical errors. For example...
<pre>
x = 1
print(x)
x = y + z
</pre>
* '''Logical error''' - program runs but does not do the right thing.
** ''Print debugging'' - One debugging method is to start printing things (values of variables) in your program starting at the beginning, run the program, make sure it is printing the values you expect, at some point you see a value you don't expect, and that tells you where to look in your code.  You often are 100% sure what you have is right, but in the end there is some problem.  So you have to ''check everything'', start at the very beginning of the program. 
** ''Disable all'' - Another strategy is to disable almost all parts of your program (e.g., put it all in comments) until you get behavior that makes sense, and then start adding things back in (uncommenting), and eventually you'll add something in that doesn't behave the way you thought, and now you know where the problem is.  Examples...
<pre>
x = 1
y = 2
z = 3
avg = x + y + z / 3
print(avg)
</pre>

Revision as of 12:50, 21 August 2026

This page is part of Programming and CS - Getting Started

For a video explaining how to get started here, see https://www.youtube.com/watch?v=uLnhcCZS4-Y&t=424s

Getting Started

  1. Reading - start reading through at least one of the following before you start working on the programming problems.
    1. w3schools Python - interactive tutorial where you can try out code in the browser
    2. Learn Python - interactive tutorial where you can try out code in the browser
    3. Automate the Boring Stuff with Python - suitable for people with very limited programming experience, this is the text that is being followed for our CS 151 course (as of 2019)
    4. Think Python - suitable for people with very limited programming experience, not very deep
    5. LearnXinYminutes - quick review once you are familiar with the basics
    6. Python.org tutorial - good for those with programming experience already
  2. Get Python installed on your computer - download the latest Python3 version at https://www.python.org/downloads/. Having python3 installed on your computer allows you to debug much quicker.
  3. Work on solving problems that are listed below.
  4. If you are a current or incoming ISU student, or an ISU alumni, get help on what you are working on using the online unix lab. When asking about the hackerrank problems make sure to refer to them using the title hackerrank gives them, or give a link to the problem statement on hackerrank.
  5. Cheat sheets - keep a cheat sheet for yourself of python syntax, built-in functions, etc. See below on this page for our model cheat sheets.

Running Python

See this video for a video demo of getting started running Python on the CS server and in IDLE.

Once you have a computer with Python installed you are ready to try it out! You can use the CS systems (computers in our classrooms and labs, or connect to the CS server - see Linux - System Setup), or install Python on your personal computer. We recommend doing both.

Run in the Terminal

On the CS server, other Linux systems, and macOS, you can run python using your terminal. If you run the command python3 then you will see the python console. Here you can type one python line at a time to run, and the results are displayed. You can try these -

2 + 3
3 * 4
10 ** 3

We normally store our python code in text files and want to run the entire file. If you have a file with python code (let's say it is named myProgram.py) then you change directories to the directory that has your file, and then type python3 myProgram.py. You can have one terminal open where you are running your program with this command, and you can have another terminal open to edit the file (or use some other text editor).

Run in IDLE

Python comes with a graphical front-end called IDLE. You can run this program if you are in the CS labs by opening your terminal and then typing idle3. If you have python installed on your personal computer, then you can find IDLE in your list of programs (Start button on Windows, Finder then click Applications on macOS) or run idle3 from the terminal (if you are using Linux). If you are connecting to the CS server with a terminal program from home, you cannot run idle3 in the terminal because it is a graphical program - you will need to install it on your home computer to use it from home.

When you start IDLE, it shows you the Python3 console, where you can type your Python3 commands. Try typing in arithmetic expressions to make sure it is working. For example -

2 + 3
3 * 4
10 ** 3

First Python Program

We store python programs in text files. You can use the following as your first python program.

print('Hello world.')
print('Hello again.')
print('Goodbye now.')

If you are using IDLE you create and run a file by -

  1. Click on File and then New File.
  2. Copy/paste or type your code in the file window that comes up.
  3. Click File and Save As. Name the file myProgram.py and save it in whichever directory you want to keep your python programs.
  4. Click Run and then Run Module. In the python console window you should see that your program ran.

If you are connecting to the CS server with your terminal from your home computer, you can choose one of the following options.

  • Create and edit the myProgram.py file with a text editor that works in the terminal - see Linux Terminal - Text Editors. Save the program and run the program with python3 myProgram.py. If you make changes, edit the program, and then run it again.
  • Edit the program using a text editor on your home computer (for example, Kate or Atom, see Linux Terminal - Text Editors), transfer to the CS server using a file transfer program (see Linux - System Setup), change directories in your terminal to the directory that has the program, and then run the program in the terminal with python3 myProgram.py

Python2 versus Python3

If you want to use Python version 2 instead, you would use commands python and idle rather than python3 and idle3. You should normally use Python3; the only reason to use Python2 is if you are using a package that is only available on Python2 (Python2 is not officially supported anymore, so this should be fairly rare).

Installing Python on Your Personal Computer

Windows and macOS Download and install from https://www.python.org/downloads/.

Linux On Linux python is probably already installed. If not do an internet search for your Linux distribution and "install python3" (i.e., search for - ubuntu install python).

Chromebook You should first get the Linux development environment enabled and then you can follow instructions for installing python3 for ubuntu. If python3 is not already installed, then running the following should do install it.

sudo apt-get update
sudo apt-get install python3
sudo apt-get install idle

Once those finish, you start idle by opening the terminal and then typing the idle command.

Lists of Problems

Programming Assignments 1

Programming Assignments - Beginning 1 - start with trying to solve these problems. Each requires a different feature of the Python programming language, so solve these problems as you read through one of the tutorials or links above. Note that the page includes a link to repl.it that contains solutions to most of the problems. If you do not have Python installed on your computer, you can try it out at repl.it - click the logo at the top, then click "+ new repl", select Python and Create Repl.

Programming Assignments - Beginning 2 - another set of classic beginning programming exercises. Some of these will be more involved.

HackerRank Problems

Once you can do some basic Python programming it is time to have some of your work checked. Hackerrank is a site where you can create an account and work on problems that will be checked if they are correct. Note that hackerrank has very strict rules for accepting correct solutions. Start with the basic problems to get a feel for what hackerrank expects.

Python programming - hackerrank problems

More Practice

If you are able to do most of the problems on the pages linked above, then you don't need us to give you lists of problems any more. You can pick problems to work through on your own. Some suggested places with problems are as follows.

Cheat Sheets and Quizzes

These cheat sheets have the highlights of some of the basic information to memorize when you are in your first year of Python programming. Note - each cheat sheet contains a sample quiz that might be used by your instructor.

Programming Errors and How to Fix Them

  • Syntax error - program is not a valid program, and normally python gives you an error message giving some indication of what the problem was.
    • Debugging - read the error message! Normally you are given a line number where python got "confused" - sometimes that is where the problem is, but you may need to look just before that line (or just after). Common syntax errors in python...
    • Mismatched () or [] or "" or , for example x = 2 * (3 + 4
    • Mis-capitalization or mis-spelling, for example Print('hello')
    • Improper indenting, for example
    • Data type problems - mixing up strings and numbers, for example x = '3' + 4
for i in range(0, 10):
print(i)
  • Runtime error - program is a valid program but when you run it something goes wrong. Debugging is similar as for syntax errors and logical errors. For example...
x = 1
print(x)
x = y + z
  • Logical error - program runs but does not do the right thing.
    • Print debugging - One debugging method is to start printing things (values of variables) in your program starting at the beginning, run the program, make sure it is printing the values you expect, at some point you see a value you don't expect, and that tells you where to look in your code. You often are 100% sure what you have is right, but in the end there is some problem. So you have to check everything, start at the very beginning of the program.
    • Disable all - Another strategy is to disable almost all parts of your program (e.g., put it all in comments) until you get behavior that makes sense, and then start adding things back in (uncommenting), and eventually you'll add something in that doesn't behave the way you thought, and now you know where the problem is. Examples...
x = 1
y = 2
z = 3
avg = x + y + z / 3
print(avg)