Python Programming/Introduction

This lesson introduces the Python programming language and environment.

Objectives and Skills
Objectives and skills for this lesson include:
 * Introduction
 * Need and evolution of Python
 * Features of Python
 * The Prompt
 * Editor and source file
 * Translation and executable
 * Installation
 * Windows and Linux installation

Readings

 * 1)  Python (programming language)
 * 2)  Integrated development environment
 * 3)  IDLE (Python)
 * 4) Python for Everyone: Why should you learn to write programs?

Multimedia

 * 1) YouTube: Python for Informatics: Chapter 1 - Introduction by Chuck Severance
 * 2) YouTube: Python Programming by Derek Banas
 * 3) YouTube: Installing Python by thenewboston
 * 4) YouTube: Installing PyCharm by thenewboston
 * 5) YouTube: Python Basics Playlist (21 videos) by John Philip Jones
 * 6) YouTube: Learn Python - Full Course for Beginners by freeCodeCamp.org

Comments
A comment starts with a hash character (#) that is not part of a string literal, and ends at the end of the physical line.

Print
The print function prints objects to standard output or to a text stream.

Exit
The exit function exits from Python.

Tutorials

 * 1) Complete one or more of the following tutorials:
 * 2) * LearnPython
 * 3) ** LearnPython: Hello, World!
 * 4) * TutorialsPoint
 * 5) ** TutorialsPoint: Python Basic Tutorial
 * 6) ** TutorialsPoint: Python Overview
 * 7) ** TutorialsPoint: Environment Setup
 * 8) * W3Schools
 * 9) ** W3Schools: Python Tutorial
 * 10) * Wikiversity
 * 11) ** Python Concepts/Why learn Python
 * 12) ** Python Concepts/Introduction and Setup
 * 13) ** Python Concepts/To Get You Started
 * 14) * Wikibooks
 * 15) ** A Beginner's Python Tutorial/Installing Python
 * 16) ** A Beginner's Python Tutorial/Very Simple Programs

Python

 * 1) Learn the differences between Python 2 and Python 3.
 * 2) Review Python.org: Should I use Python 2 or Python 3 for my development activity?
 * 3) Download and install Python.
 * 4) Review TutorialsPoint: Python 3 Environment Setup.
 * 5) Download Python from Python.org: Downloads.
 * 6) Install Python.
 * 7) At a command prompt or terminal window, run the command   or   to confirm Python installation and display the version number.
 * 8) Use the Python interpreter.
 * 9) At a command prompt or terminal window, run the command   or   to start the Python interpreter.
 * 10) At the Python prompt, enter , replacing   with your name.
 * 11) At the Python prompt, enter   to exit Python.

Python IDEs

 * 1) Use the Python IDLE integrated development environment.
 * 2) Review  IDLE (Python).
 * 3) Run IDLE on your system.
 * 4) At the Python prompt, enter , replacing   with your name.
 * 5) At the Python prompt, enter   to exit IDLE.
 * 6) Download and install another Python integrated development environment (IDE).
 * 7) Review TechAltair: 7 Best Python IDE for Pythonist.
 * 8) Select and download one of the recommended Python IDEs. Chose PyCharm Community Edition if you are unsure which one to select.
 * 9) Install the IDE.
 * 10) Run the IDE.
 * 11) In a new file, enter , replacing   with your name.
 * 12) Save the file as hello.py.
 * 13) Run the script and observe the results.
 * 14) Exit the IDE.
 * 15) Use a free cloud-based Python IDE.
 * 16) Review  Cloud9 IDE.
 * 17) Create a free account at Cloud9.
 * 18) Using Cloud9, create a new private workspace. Name the workspace whatever you like, or use  . Choose Python as the workspace template.
 * 19) Once the workspace starts, examine the Cloud9 IDE.
 * 20) Cloud9 has both Python 2 and Python 3 installed. At the bash prompt, run the command   to start the Python 2 interpreter.
 * 21) At the Python prompt, enter , replacing   with your name.
 * 22) At the Python prompt, enter   to exit Python.
 * 23) At the bash prompt, run the command   to start the Python 3 interpreter.
 * 24) At the Python prompt, enter , replacing   with your name.
 * 25) At the Python prompt, enter   to exit Python.
 * 26) Create a new file in the Cloud9 IDE.
 * 27) In the new file, enter , replacing   with your name.
 * 28) Save the file as hello.py.
 * 29) Run the script and observe the results.
 * 30) In the lower Run window, change the Runner to Python 3.
 * 31) Run the script and observe the results.
 * 32) To set Python 3 as the default runner, use Run / Run Configurations / Manage and set Python Version to Python 3.
 * 33) Exit Cloud9.

Games

 * 1) Play CodeCombat Kithgard Dungeon levels 1 - 4.

Documentation

 * 1) Read stackoverflow python questions: https://stackoverflow.com/questions/tagged/python?tab=Votes

Lesson Summary

 * Python is a widely used high-level, general-purpose, interpreted, dynamic programming language.
 * A high-level programming language is a programming language with strong abstraction from the details of the computer.
 * An interpreted language is a programming language for which most of its implementations execute instructions directly, without previously compiling a program into machine-language instructions.
 * There are three major versions of Python (1.x, 2.x, and 3.x). Python 2 and Python 3 are both considered current, stable languages. Python 3 is not backward-compatible with Python 2.
 * Most Python implementations support a command-line interface / command-line interpreter in which users may enter statements sequentially and receive the results immediately. This sequence is known as a read–eval–print loop (REPL).
 * The Python interpreter may also execute scripts, which are collections of Python source code saved as a file or files.
 * A variety of Integrated Development Environments (IDEs) are available for Python. IDEs normally consist of a source code editor, build automation tools, and a debugger. Most modern IDEs also have intelligent code completion.
 * IDLE (Integrated DeveLopment Environment) is an integrated development environment for Python, which has been bundled with the default implementation of the language since 1.5.2b1.
 * A Python comment starts with a hash character that is not part of a string literal, and ends at the end of the physical line.
 * The  function prints objects to standard output or to a text stream.
 * The  function exits from Python.
 * Python files use the filename extension.

Key Terms

 * bug
 * An error in a program.


 * central processing unit
 * The heart of any computer. It is what runs the software that we write; also called “CPU” or “the processor”.


 * compile
 * To translate a program written in a high-level language into a low-level language all at once, in preparation for later execution.


 * high-level language
 * A programming language like Python that is designed to be easy for humans to read and write.


 * interactive mode
 * A way of using the Python interpreter by typing commands and expressions at the prompt.


 * interpret
 * To execute a program in a high-level language by translating it one line at a time.


 * low-level language
 * A programming language that is designed to be easy for a computer to execute; also called “machine code” or “assembly language”.


 * machine code
 * The lowest-level language for software, which is the language that is directly executed by the central processing unit (CPU).


 * main memory
 * Stores programs and data. Main memory loses its information when the power is turned off.


 * parse
 * To examine a program and analyze the syntactic structure.


 * portability
 * A property of a program that can run on more than one kind of computer.


 * print statement
 * An instruction that causes the Python interpreter to display a value on the screen.


 * problem solving
 * The process of formulating a problem, finding a solution, and expressing the solution.


 * program
 * A set of instructions that specifies a computation.


 * prompt
 * When a program displays a message and pauses for the user to type some input to the program.


 * secondary memory
 * Stores programs and data and retains its information even when the power is turned off. Generally slower than main memory. Examples of secondary memory include disk drives and flash memory in USB sticks.


 * semantics
 * The meaning of a program.


 * semantic error
 * An error in a program that makes it do something other than what the programmer intended.


 * source code
 * A program in a high-level language.

Assessments

 * Flashcards: Quizlet: Python - Introduction
 * Quiz: Quizlet: Python - Introduction