Difference between revisions of "Python Programming - Getting Started"

From Computer Science
Jump to: navigation, search
(Cheat Sheets)
(Getting Started)
Line 13: Line 13:
 
# '''Work on solving problems''' that are listed below.
 
# '''Work on solving problems''' that are listed below.
 
# '''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.
 
# '''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.
# If you are a current or incoming ISU student, or an ISU alumni, '''sign up for the ISU CS Mattermost''' at https://judy.indstate.edu.  Note that you need to use your @sycamores.indstate.edu email address to sign up.  Look for the Python Programming Channel (direct link is https://judy.indstate.edu/isu-cs/channels/python-programming).  When asking about the hackerrank problems make sure to refer to them using the title hackerrank gives them.
 
 
Let's see how far you can get with solving the hackerrank problems!  Good luck!
 
  
 
==Running Python on ISU CS Systems==
 
==Running Python on ISU CS Systems==

Revision as of 15:07, 16 January 2020

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. Learn Python - interactive tutorial where you can try out code in the browser
    2. 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)
    3. Think Python - suitable for people with very limited programming experience, not very deep
    4. LearnXinYminutes - quick review once you are familiar with the basics
    5. 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. 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 on ISU CS Systems

If you are using one of the CS lab computers or have a terminal open connected to the CS server, you can run python programs using one of the following methods.

Execute in the terminal Edit your python code with a text editor, and run it with the python3 or python command. For example,

cd ~
nano hello.py
# and put some python code in hello.py then exit nano
python3 hello.py

If you want to run the program with Python2, you would use the command python rather than python3.

Idle You can use the builtin Python3 graphical editor to edit your programs and also run them (only if you are on one of the lab computers or tunneling X). The command for Python3 is idle3, and the command for Python3 is idle.

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

These cheat sheets have the highlights of some of the basic information to memorize when you are in your first year of Python programming.