CIS 3120 Lecture 1: Introduction to Python
1/29/19: Introduction to Python Programming
• Intro to computers and programming [powerpoint]
o Hardware: cpu, memory, storage, input and output
o Software: application
• Storing data:
o 0s and 1s
o Human computers, babbage difference engines, vacuum tube computer
o 8 bits are a byte
o Bit: holds negative or positive charge
o Memory location, use bigger bytes to store larger #’s
• Storing characters: numeric is stored in memory
o ASCII: code for 128 characters
o Unicode: represents characters for other languages
• How a program works:
o What a cpu does
o What RAM is
o Fetch, decode, execute
• Machinery → assembly
o Assembly: uses short words for instructions rather than binary numbers
o Assemblers: translates assembly language to machine language for the CPU
• High-level language: allows simple creation of powerful programs. Don’t need to know how
CPU works
• Vocabulary:
o Key-words: pre-defined words. Like string, integer. Have a specific meaning
o Operators: perform operations. Add, subtract
o Syntax: set of rules to be followed when writing program
o Statement: instructions
o Compiler: translates high-level language program (psuedo english) to machine language
(0s and 1s)
o Interpreter: translates and executes instructions. One instruction at a time. Easier to deal
with and troubleshoot. Python is an interpreter. Runs while you are writing code. Can
debug and run program from that
o Source code: code written by the programer
• Python: Save python script (end in py) or interactive mode (anaconda)
1/31/19: Designing a Program
• Designing a program [powerpoint]
o Design, write the code, correct errors, test, correct errors, repeat
o Design is the most important part of the program development cycle
o Purpose of program is to perform. Program is doing what it was meant to do. Not enough
talks with the users? Work with customer, ask questions about program details, create
software requirements
▪ Type 1 feedback
▪ Typ2 feedback - am I doing what I’m supposed to do
• Algorithm: a set of well-defined logical steps that must be taken to perform a task.
• Pseudocode: Fake code