CIT 590 Intro to Programming Lecture 1. By way of introduction … Arvind Bhusnurmath There are no bonus points for pronouncing my last name correctly Please.

Slides:



Advertisements
Similar presentations
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Advertisements

FORTRAN Short Course Week 1 Kate T-C February 17, 2008.
Intro to Programming Lecture 1
Intro to CIT 594
CIT 590 Intro to Programming Lecture 2. Agenda ints, floats, strings, booleans Conditionals Loops Functions Testing The concept of scope.
CIT 590 Intro to Programming Lecture 1. By way of introduction … Arvind Bhusnurmath There are no bonus points for pronouncing my last name correctly Please.
16-May-15 Sudden Python Drinking from the Fire Hose.
Introduction to Computer Programming I CSE 113
Intro to CIT 594
Intro to CIT 594
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
OBJECT ORIENTED PROGRAMMING I LECTURE 1 GEORGE KOUTSOGIANNAKIS
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
CIT 590 Intro to Programming First lecture on Java.
Intro to CIT 594
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
Recitation 1 Programming for Engineers in Python.
Welcome to CS 115! Introduction to Programming. Class URL Please write this down!
CS110/CS119 Introduction to Computing (Java)
An Introduction to Textual Programming
COMP Introduction to Programming Yi Hong May 13, 2015.
Introduction to Python
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Prof. Matthew Hertz SH 1029F /
General Programming Introduction to Computing Science and Programming I.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
Prof. Matthew Hertz WTC 207D /
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
17-Dec-03 Intro to CIT 594 ~matuszek/cit594.html.
CIT 590 Intro to Programming Lecture 4. Agenda Doubts from HW1 and HW2 Main function Break, quit, exit Function argument names, scope What is modularity!
CIT 590 Intro to Programming First lecture on Java.
Welcome to CS 115! Introduction to Programming. Class URL Write this down!
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Class 1: What this course is about. Assignment Read: Chapter 1 Read: Chapter 1 Do: Chapter 1 ‘workbook’ pages not finished in class Do: Chapter 1 ‘workbook’
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
ECS 15 Variables. Outline  Using IDLE  Building blocks of programs: Text Numbers Variables!  Writing a program  Running the program.
1 CS1100 Fall Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems CS100J:
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
A First Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington Credits: a significant part of.
Data Structures and Algorithms in Java AlaaEddin 2012.
Algorithms and Pseudocode
1 CS100J Spring Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
CIT 592 Discrete Math Lecture 1. By way of introduction … Arvind Bhusnurmath There are no bonus points for pronouncing my last name correctly Please call.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
Computer Science I ISMAIL ABUMUHFOUZ | CS 180. CS 180 Description BRIEF SUMMARY: This course covers a study of the algorithmic approach and the object.
Development Environment
Week 1 Gates Introduction to Information Technology cosc 010 Week 1 Gates
CS 240 – Lecture 11 Pseudocode.
CS190/295 Programming in Python for Life Sciences: Lecture 1
Welcome to CS 1010! Algorithmic Problem Solving.
Learning to Program in Python
Learning to Program in Python
Welcome to CS 1010! Algorithmic Problem Solving.
Loops CIS 40 – Introduction to Programming in Python
Accelerated Introduction to Computer Science
A look at Python Programming Language 2018.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
12th Computer Science – Unit 5
Unit 3: Variables in Java
CSCI 203: Introduction to Computer Science I
Presentation transcript:

CIT 590 Intro to Programming Lecture 1

By way of introduction … Arvind Bhusnurmath There are no bonus points for pronouncing my last name correctly Please call me Arvind. I am pretty informal. Graduated 2008 from Penn Ex GRASPee – thesis on convex optimization in computer vision Worked in Software for 5 years – APT

Who is this course for? non CS majors People who want to learn the basics of programming and have never programmed before People who have programmed before but have not used that skill in a long time

Who should not take the course If you have written a project in any programming language Programming languages come and go, you do not need to take a course just to learn a new language People who have a lot of other coursework This course will require a time commitment Programming assignments every week – most of them are not super easy People who want to work alone Pair programming is an essential part of the course If you drop/waive the course, people on the waiting list will be very happy.

Contents of the course 50% Python and 50% Java Why begin with Python? Easier language to pick up you can spend more time thinking about programming logic and algorithms, and less time thinking about correct syntax Interpreted language (more on that in a bit) An actual commercially used language in places like Google, Youtube most of the lines of code for YouTube are still in Python. Everytime you watch a YouTube video you are executing a bunch of Python code. Why transition to Java? Object oriented programming (the cool prevalent paradigm) Used in many many applications Android applications are in Java Higher chances of getting a job

Keeping track of CIT590 schedule.html schedule.html If you are curious and want to read ahead ml ml Go to staff.html for office hours staff.html Piazza will be used for class discussion and clarifications – please use it heavily!

Resources for Python Exploring Python by Timothy Budd Use this book as an active participant. Read it with a computer in front of you and typing things out as you go along. Highly highly recommend buying this book. Byte of Python – free e-book that you can download and carry around as a handy reference Byte of Python Examples Examples Contains a bunch of examples from the previous course Caution: some might not be relevant so please follow along in class

Exams, homeworks etc Homework every week. Deadlines will be strictly enforced. If you do have an emergency, send me or have one of your classmates send me Homework will be worth 45% of the grade Mid term 20% Final exam 25% Class participation 10%

Class participation? Lab (recitation) attendance is mandatory! If you have a reason to miss it, please inform me at least a day in advance ‘I have an on-site interview’ is a valid excuse only if you tell me which company and provide some evidence of the invite Be a nice partner! We had some horror stories last semester One question on your final exam will be who was your best and worst partner Ask questions on Piazza Sign up and ask questions I really want to promote discussion Ask questions in class Tougher to keep track of who asked what

Lectures and labs 2 lectures and 1 lab every week We will cover a mix of syntactic aspects as well as elements of programming style Encouraged to bring laptops to class to follow along If you spend time playing candy crush … oh well Tough to wait until every one has managed to run their program so slides being used

How to turn in assignments Canvas Assignments will be due on Friday mornings Essentially think of Thursday midnight as your deadline

Requisite slide about plagiarism and cheating DON’T CHEAT!!

Python Created by Guido Van Rossum. Actually named after Monty Python and not after animals that squeeze their prey to death

Python Interpreted language No compilation If you’ve seen matlab or R this paradigm will look familiar There is no intermediate stage when you run the program This does mean that sometimes it is hard to figure out mistakes in a program

Python config Use python 2 and not python 3 We will try to stick to the IDLE for editing Remember to save your file as xyz.py before beginning to edit Other options for editing a python file (I will stick to using IDLE) Vim/vi Emacs Notepad++ Sublime text Eclipse with PyDev

Python demo IDLE Throwing commands into the shell Configuring IDLE More on this in the lab session Data types Integers Float Boolean 5/2 is not 2.5. However both 5.0/2.0, 5/2.0 are Strings – single, double and triple quotes There are tons of operators. Please spend some time experimenting with them Do not worry about the bit shift operators for now Do not worry about making mistakes. ‘With every mistake we must surely be learning’ – George Harrison

Variables in python Variables are used to keep track of information within a program An assignment statement is of the form Variable name = value Proper naming of variables is important. Variables that store the first, second and third highest scores in a test a, b, c = bad first, second, third = better Randomly named variables will result in loss of points in assignments You cannot use space, but can choose between second_best or secondBest(camel casing) “ Programs must be written for people to read, and only incidentally for machines to execute. ” - Abelson

Strings Strings are basically just collections of characters Can be indexed Always remember 0 indexing Strings are immutable Once a string is assigned to a variable, you cannot mess around with the characters within the string

Operators Experiment with operators in class to see ** used for power operation // used for divide and floor simpleMath.py

Functions in python Similar to the math concept of functions Functions on strings Functions that convert from one data type to another The fun ‘eval’ function Input and output functions Raw_input – to read in string input Print – to print out something Input – to read in an integer or float

Writing a program A sequence of statements that will be executed one by one Remember to save your file with the extension “.py” tempConv.py

Example program Temperature converter example from the book Testing! No code is complete until tested In the industry, there are entire jobs associated with testing

Assignment statement Python has a very flexible assignment syntax area = length * breadth counter1 = counter2 = 0 area, perimeter = length * breadth, 2 * (length + breadth) x, y = y, x Extremely elegant way to swap the values of two variables

Reading input from a user To read an integer the syntax is I = input(“enter an integer”) The “enter an integer” portion is called the prompt and it can be any string Quick tip – Use “\n” if you want to move to the next line in a prompt I = input(“enter an integer\n”)

Conditionals If Syntax is if : If, else and the importance of proper indentation Python does not have open braces or anything like that to indicate code blocks! Everything is about indentation The elif Example program guessingGame_v1

While loops Repeated execution of a task is done via a loop Example program multiplicationTable.py Infinite loops CTRL + C is your best friend it will pause execution Good rule for while loops Write some kind of incrementer/decrementer down ASAP Make sure the program can exit the loop regardless of whether the task is accomplished or not An infinite loop is an example of what is called a “bug” A bug can be a syntax error (easily detectable and hence very rare these days) A line of code that has an undesirable effect is also a bug

For loop When we have an arithmetic progression for x in range(0,10): Includes the 0, does not include the 10! for x in range(0,10,2): When we are looping through characters in a string for letter in ‘bhusnurmath’:

Example program in Python For loop Conditionals beer.py