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
Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
Advertisements

Intro to Python Welcome to the Wonderful world of GIS programing!
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.
Intro to Programming Lecture 1
CIT 590 Intro to Programming Lecture 2. Agenda ints, floats, strings, booleans Conditionals Loops Functions Testing The concept of scope.
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
Please pick up an attendance question and submit in 5 minutes CS 1003 Lecture #3 Sept 12, 2006 Knarig Arabshian.
Python November 18, Unit 7. So Far We can get user input We can create variables We can convert values from one type to another using functions We can.
Introduction to Python
Python Crash Course by Monica Sweat. Python Perspective is strongly typed, interpreted language is used to define scripts (Don't even need to define a.
Honors 101, Fall 2006 Please do not sit in back of room! Lots of info on web page Join the mailing list Download Eclipse and start using it Read the text.
CIT 590 Intro to Programming First lecture on Java.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
Recitation 1 Programming for Engineers in Python.
Fundamentals of Python: From First Programs Through Data Structures
Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved.
Lecture 2 - Variables, program execution, calculations, print() COMPSCI 101 Principles of Programming.
The University of Texas – Pan American
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
Fundamentals of Python: First Programs
An Introduction to Textual Programming
Intro to Programming Lecture 13
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.
Munster Programming Training
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
STRINGS CMSC 201 – Lab 3. Overview Objectives for today's lab:  Obtain experience using strings in Python, including looping over characters in strings.
Computer Science 101 Introduction to Programming.
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!
By the end of this session you should be able to...
CIT 590 Intro to Programming First lecture on Java.
Python – May 11 Briefing Course overview Introduction to the language Lab.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
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:
CS2910 Week 2, Class 1 Today Data Encoding, Part 1 Parsing Data Python Muddiest Point Lab 2 – Bring text In Class, Thursday: Quiz Week 6, Monday: Midterm.
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.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
A First Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington Credits: a significant part of.
8 January 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
Data Types and Conversions, Input from the Keyboard CS303E: Elements of Computers and Programming.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
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.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
Introduction to Programming
Lesson 06: Functions Class Participation: Class Chat:
Exam #1 You will have exactly 30 Mins to complete the exam.
Topic: Python’s building blocks -> Variables, Values, and Types
CS1022 Computer Programming & Principles
Introduction to Python
Topic: Python’s building blocks -> Variables, Values, and Types
Functions CIS 40 – Introduction to Programming in Python
Introduction to Programming
Engineering Innovation Center
CS 240 – Lecture 11 Pseudocode.
Thinking about programming
CS190/295 Programming in Python for Life Sciences: Lecture 1
Introduction to Python
Introduction to Programming Using Python PART 1
Lesson 06: Functions Class Chat: Attendance: Participation
Computer Programming 1 introduction to JAVA Lecture 1 Instructor: Ruba A. Salamah Islamic University of Gaza.
A look at Python Programming Language 2018.
Thinking about programming
Thinking about programming
General Computer Science for Engineers CISC 106 Lecture 03
Python Basics. Topics Features How does Python work Basic Features I/O in Python Operators Control Statements Function/Scope of variables OOP Concepts.
PYTHON - VARIABLES AND OPERATORS
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 New to teaching at Penn However, not new to Penn. Graduated 2008 Ex GRASPee – thesis on convex optimization in computer vision

Who is this course for? non CS majors. 591 is the preferred course for MCIT. 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 while

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? Instills the fundamentals of object oriented programming Used in many legacy applications Android applications are in Java Higher chances of getting a job

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. Byte of Python – free e-book that you can dowload and carry around as a handy reference Byte of Python

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 Lab (officially called recitation) every Friday. The 10:30 slot will be led by the TAs I will show up for most 1:30 pm recitations Homework will be worth 55% of the grade Mid term 20% Final exam 25%

How to turn in assignments Canvas This is the first semester that the whole university is moving to this system. Should work, but please be patient

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

Python Interpreted language No compilation Dynamic typing If you’ve seen matlab or R this paradigm will look familiar

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 Lots of other options (Notepad++, Sublime Text, Pydev in Eclipse) for editing a python file but I will stick to IDLE

Python demo Using IDLE Throwing commands into the shell Configuring IDLE More on this in the lab session Data types Integers Float Boolean Strings – single, double and triple quotes Conversion between datatypes – str, int 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 An assignment statement is of the form Variable name = value Proper naming of variables is important. 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 Slicing a string

Operators Experiment with operators in class to see 2 ** 3 7 % 5 65 // 11 ‘abc’ ** 3 Binary bitwise operations?

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 Print input

Writing a program tempConv.py

Writing a function def (arguments): function body … return output value tempConversionFunc.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

Conditionals If If, else and the importance of proper indentation The elif statement (because we got so tired of writing ‘else if’)

While loops Repeated execution multiplicationTable.py Infinite loops CTRL + C is your best friend

For loop When we have an arithmetic progression for x in range(1,10) When we are looping through characters in a string for ch in ‘Philadelphia’

Example program in Python For loop Conditionals numWords.py

Summary Logistics of the course Python setup Lots of examples using the Python shell Please do try out some more at home! Conditionals - if, else, elif Loops Writing an actual program The importance of commenting Indentation not only is it key, Python will simply not work for you if you disobey the indentation rules)