Welcome to Introduction to Computers and Programming Course using Python

Similar documents
EKT150 Introduction to Computer Programming. Wk1-Introduction to Computer and Computer Program

CS 40 Computing for the Web

Chapter 13: Program Development and Programming Languages

Chapter 13: Program Development and Programming Languages

CS 51 Intro to CS. Art Lee. September 2, 2014

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class

McGraw-Hill The McGraw-Hill Companies, Inc.,

Fall 2012 Q530. Programming for Cognitive Science

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

Syllabus for CS 134 Java Programming

Welcome to Introduction to programming in Python

3 SOFTWARE AND PROGRAMMING LANGUAGES

Programming in Python. Basic information. Teaching. Administration Organisation Contents of the Course. Jarkko Toivonen. Overview of Python

Computer Programming. Course Details An Introduction to Computational Tools. Prof. Mauro Gaspari:

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

A Python Tour: Just a Brief Introduction CS 303e: Elements of Computers and Programming

CSci 538 Articial Intelligence (Machine Learning and Data Analysis)

Programming Languages

Instructor. Phone: (855) 11:00 12:00 TH. This. released. industry is the. tested and. have. textbooks and. computer Software ts.

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Python Programming: An Introduction to Computer Science

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

Chapter 12 Programming Concepts and Languages

Using Python in a High School Computer Science Program

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

CS 261 C and Assembly Language Programming. Course Syllabus

Python Programming: An Introduction to Computer Science

Software. Programming Language. Software. Instructor Özgür ZEYDAN. Bülent Ecevit University Department of Environmental Engineering

CS 106 Introduction to Computer Science I

02-201: Programming for Scientists

Thursday 11:00 a.m. - 12:00 p.m. and by appointment

Software: Systems and Application Software

CSE 307: Principles of Programming Languages

Introduction: How does a student get started? How much time does this course require per week?

MIT The Fundamentals of Computer Programming Fall Credits Watson School of Education University of North Carolina Wilmington

#820 Computer Programming 1A

CS1400 Introduction to Computer Science

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Programming Languages & Tools

The course assumes successful completion of CSCI E-50a and CSCI E-50b, i.e. at least two semesters of programming, with a grade of C- or better.

Introduction to Computers and Programming

CS 1340 Sec. A Time: 8:00AM, Location: Nevins Instructor: Dr. R. Paul Mihail, 2119 Nevins Hall, rpmihail@valdosta.

COMPUTER SCIENCE Introduction to Programming: Visual Basic 1 CIHS C++ AP Java

OPERATING SYSTEM SERVICES

Java in Education. Choosing appropriate tool for creating multimedia is the first step in multimedia design

CMSC Fundamentals of Computer Programming II (C++)

What is a programming language?

How To Understand Programming Languages And Programming Languages

Fundamentals of Programming and Software Development Lesson Objectives

Lesson 06: Basics of Software Development (W02D2

ATSBA: Advanced Technologies Supporting Business Areas. Programming with Java. 1 Overview and Introduction

CSCI 3136 Principles of Programming Languages

CSC 234 Game Design M/W 5-7:20PM D207

Instructor Özgür ZEYDAN BEU Dept. of Enve. Eng. CIV 112 Computer Programming Lecture Notes (1)

Texas Essential Knowledge and Skills Correlation to Video Game Design Foundations 2011 N Video Game Design

Some programming experience in a high-level structured programming language is recommended.

Chapter 14. Programming and Languages. McGraw-Hill/Irwin. Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved.

Ch. 10 Software Development. (Computer Programming)

Interactive Media Design

RARITAN VALLEY COMMUNITY COLLEGE COURSE OUTLINE. CISY 103 Computer Concepts and Programming

BRAZOSPORT COLLEGE LAKE JACKSON, TEXAS SYLLABUS ITSE 1432 INTRODUCTION TO VISUAL BASIC.NET PROGRAMMING

Chapter 1. The largest computers, used mainly for research, are called a. microcomputers. b. maxicomputers. c. supercomputers. d. mainframe computers.

International Engineering Journal For Research & Development

Math 35 Section Spring Class meetings: 6 Saturdays 9:00AM-11:30AM (on the following dates: 2/22, 3/8, 3/29, 5/3, 5/24, 6/7)

Chapter 1 Introduction to Computers, Programs, and Java

CS 253: Intro to Systems Programming

COURSE TITLE COURSE DESCRIPTION

C# and Other Languages

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department

COMPUTER SCIENCE TECHNOLOGY ITSC 1301 INTRODUCTION TO COMPUTERS Website: Course Syllabus

MEAP Edition Manning Early Access Program Hello! ios Development version 14

Computer Science. General Education Students must complete the requirements shown in the General Education Requirements section of this catalog.

Counselor Lesson Plan

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

MGSC 290 Computer Information Systems in Business SYLLABUS Spring 2008

Math Online Calculus I Course Syllabus

Course: ISYS 4373 Application Development with Java Prerequisite: ISYS 3293

Computer Science 1015F ~ 2010 ~ Notes to Students

Basics of Computer 1.1 INTRODUCTION 1.2 OBJECTIVES

CS 300 Data Structures Syllabus - Fall 2014

Software: Systems and. Application Software. Software and Hardware. Types of Software. Software can represent 75% or more of the total cost of an IS.

EMC Publishing. Ontario Curriculum Computer and Information Science Grade 11

Overview and History of Operating Systems

AP Psychology Course Syllabus and Survival Guide

CS135 Computer Science I Spring 2015

Bergen Community College - Information Technology Course Syllabus

Operating Systems Introduction

Welcome to Cinema 105 online!

Subject knowledge requirements for entry into computer science teacher training. Expert group s recommendations

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Computer Programming I & II*

2667A - Introduction to Programming

6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang

Transcription:

Welcome to Introduction to Computers and Programming Course using Python V22.0002, Section 3, Spring 2010 Course Introduction Professor: Sana Odeh odeh@courant.nyu.edu Office hours: Mondays 2:00 pm - 4 pm, room 321 in WWH, or at other times by appointment

Road Map for Today Course Description What material will we cover? What am I getting myself into? Administrative Issues Course Web Page, Text Book, Exams, Office Hours, Homework, Grading, Cheating Policy, etc. Syllabus Intro. to Programming Languages and Python 2

Course Prerequisites Prerequisites: This course in intended for students who have no previous experience in programming (No prior programming experience required (Really) The focus of the course is to provide you with an elementary introduction to programming in Python. It s open to all students who are interested in programming from any field or background (such as Film, journalism, economics, education, math, biology and so on.) Who should be taking this course: Students who are interested in programming Students who want to take a computer science minors or Web Applications and Programming minor (http://cs.nyu.edu/web/academic/undergrad/minors.html) Students who want to switch to a computer science major You must get a c or better in this class to take further computer science classes. Who should NOT be taking this course Students trying to get out of taking a math requirement. This class may be more difficult than the math you are trying to avoid. 3

Course Description In this course, we will study the fundamentals of computer programming... one of the towering intellectual achievements of the 20th century. We will design, code, and debug programs using Python as we explore these concepts. Python is a popular programming language, widely used in business, entertainments, science, arts, games, mobile apps. Famous companies that use Python are Google, Pixar, Disney, NASA, and Yahoo! 4

This is all Computer Science? 5

Why learn programming continued? The purpose of this course is to teach you about computing, but particularly, programming in Python (a powerful, widely-used programming language). Why care about computers and programming? Growing field with great opportunity (read: $) Creative Challenging Fun (Developing Games for example) Enabling/Empowering, creative and innovative technology 6

What the class is really about Course Objectives: 1. We will learn to program in Python. This includes all the rules (SYNTAX) that are specific to Python. 2. We will cover the fundamentals of programming (shared concepts in all high level programming languages): Variables and data types Control Structure Repetition Functions Data Structure Input and output (including files I/O) Introduction to GUI (Graphical User Interface) programming: Learn how to write programs integrating, graphics, and sound. Introduction to web programming (CGI): writing simple programs that will run on the web 7

Book Chapters to be covered in this class: Most readings will be assigned from the Visual Quick start book since it is using the current python version 3. But, it will be important to do similar readings from the Gaddis book since it provides more explanations about programming concepts covered in this class. Chapter 1 Introduction to Computers and Programming Chapters 2 Arithmetic, variables and data types (Strings)s Chapters 3 Writing Programs Chapter 4 Control Structure and Repetition Chapter 5 Functions Chapter 6: Strings Chapter 7: Data Structures (Tuples, lists, Dictionaries) Chapter 8:Input and output (File I/O) Chapter 9: Exceptions Additional topics, depending on time (Gaddis book): Chapter 12: GUI Programming CGI Web Programming: An introduction to using Python for writing scripts to build Webpages 8

Learn the Core Concepts of all Programming Languages There are many programming languages available: C++, C, Python, Ada, Perl, Ruby, Python. All of these languages share core concepts. By focusing on these concepts, you are better able to learn any programming language. Note: Python is an object oriented programming language. However, we will not touch upon the concepts which categorize it as one. Python is easy to learn and also easy to develop programs with graphics, sound capabilities for games, animation for Arts and sciences and output programs for the web (CGI). 9

Python is much easier to learn than other programming languages let s s see how can print one line using Python and python what do you think? // Hello Program in Python public class welcome1 { public static void main( S tring args[] ) { S ystem.out.println( Hello students and welcome to programming " ); } // end method main } // end class Welcome1 # Hello program in Python print ( Hello students and welcome to programming ) 10

An Example: Loops Python has a construct called a while loop that enables a program to repeat actions over and over. Most other languages also have a for loop. Hence, by learning about for loops in Python, you can easily learn while loops in C, C++, Python, PythonScript, Perl. 11

Here is a Sample Program in Python # Sample Program in Python Guess the secret word """ This program will ask the user to guess the secret word repeat until the user gets the correct answer """ repeat= True secret= "Python" tries = 3 while repeat: guess = input("guess the secret word to win $100: Please enter your guess here : ") tries = tries - 1 if guess == secret: print () print ("Congratulations! You won $100!") repeat = False This program will try to guess the secret word in 3 tries to win $100. In a few weeks, it will all make sense (I promise!) else: print ("Wrong guess!") if tries == 0: print () print ("Game is over. You only have three tries") repeat = False else: print () print ("Keep trying: You have %d tries remaining" % tries) 12

Administrative Matters 13

Course Web Site Course web site is available at: http://www.cs.nyu.edu/courses/spring010/v22.0002-003/index.html Web site contains the following information: Administrative information Course Syllabus Homework assignments Class notes Class programs Sample exams Software instructions Tutoring information 14

Course Text Book Please keep up with the reading! I will post readings both in the primary textbooks and in additional readings available on-line from the Bobst Safari library. Required BOOK: 1) Python: Visual QuickStart Guide, 2nd Edition By Toby Donaldson Copyright 2009 o ISBN-10: 0-321-58544-5 o ISBN-13: 978-0-321-58544-8 Optional TextBooks: 1) How to Think Like a Computer Scientist - Learning with Python 2nd Edition -- free by Jeffrey Elkner, Allen B. Downey, and Chris Meyers Chapters and examples are posted online: http://openbookproject.net/thinkcs/python/engli sh2e/index.html 15

Software For the course, we will be using Python and Idle We will discuss installation and how to use software in class These programs are free and you can download and use them for your home computer. Install the latest version of Python version 3.1.1 (Instructions will posted on the course website) Python 3.1.1 was released on August 17th, 2009. 1. IDLE, a GUI Program that will make it easy for you to write, edit and debug python programs, is bundled with python (no need to download separately) 16

Grading Your grade will be determined as follows: Midterm (30%) Homework (30%) Final Exam (40%) Class participation will help your grade! 17

homework Ten points will be deducted for each class day late, with a possible maximum of 30 points being deducted. Home works will not be accepted after the third class following its due date. For each assignment that you do not hand in within the time limit, your final grade will be lowered by one letter grade ( i.e., if you are averaging a B+, but you have missed 2 home works, your final grade will be B-). Students who spend little time on the homework invariably do poorly on exams and end up with a poor final grade. Very Important For your own good you must save all programs on back-up (USB or flash drives). Make and keep copies of all your programs at all times. Lost programs or crashed systems do not provide adequate excuses for missing or late homework. 18

A Word About Cheating For the purposes of this class, cheating is defined as: Discussing homework concepts is fine, but you must submit your own work. Copying all or part of another student's homework, project or exam. Allowing another student to copy all or part of your homework, project, or exam. Please note that If you are caught cheating, you will receive an immediate FAILURE for the course. Copying ideas, text or a line of code (segment) from an outside resources is NOT allowed without prior attribution : Make sure to read the CS department statements on Academic Integrity for more details. If you are caught cheating, you will receive an immediate FAILURE for the course. 19

Student Civility In an effort to make this class enjoyable for everybody Please be on time to class! Please do not talk to your friends and neighbors in class! It disturbs everyone, and makes it hard to concentrate. If you have a question, just ask me! Don t be distracted by passing notes to your neighbors during class. Don t use laptops to read emails and browse the web during class Please turn your pagers and cell-phones off! If you are sick and can t make it to class, make sure to check the website for class work and also and try to get notes from your classmate Class buddy: Let s do this now: Please turn to your neighbor and get her/his contact info so you can contact when you need to get notes or other class related info 20

Getting Help * Help: Whenever you have a question about the course material, please feel free to drop by during my office hours or write me an email message. If at any time you feel that you are falling behind or are overwhelmed by the material, let me know: I will be very happy to help you. Option 1: Come to my Office Hours Office Hours: Mondays: 2 pm - 4 pm in room 321 in WWH, or at other times by appointment Location: Room 321 Warren Weaver Hall I get bored when nobody visits! If you cannot make my office hours, I will be happy to make an appointment with you. Please try to give me advance warning when you need an appointment. 21

Getting Help Help is always available! Option 2: See tutors. Two lab tutors will devote 10 hours each week to be help you with your homework. The tutors will be in room 328 in WWH Option 3: Email the class e-tutor, should respond within 24 hours. For more information on tutoring, please go to the Tutoring/Help page on the course website: http://www.cs.nyu.edu/courses/spring10/v22.0002-003/tutoring.htm Option 4:Other help options: CAS Free Peer to Peer tutoring: College Learning Center (located on campus and housed in Weinstein residence hall) offers free peer tutoring for our class. Please note that this effort is not organized by the Computer Science Department and you need to contact the College Learning Center for more information or go to http://www.nyu.edu/cas/clc/. 22

What Is a Computer? Computer Performs computations and makes logical decisions Millions / billions times faster than human beings Computer programs / software Sets of instructions that tells the computer what to do Hardware Physical devices of computer system 23

Computer Organization Six logical units of computer system Input unit Mouse, keyboard Output unit Printer, monitor, audio speakers Memory unit Retains input and processed information Arithmetic and logic unit (ALU) Performs calculations Central processing unit (CPU) Supervises operation of other devices Secondary storage unit Hard drives, floppy drives 24

Evolution of Operating Systems Batch processing One job (task) at a time Operating systems developed Programs to make computers more convenient to use Switch jobs easier Multiprogramming Simultaneous jobs Timesharing operating systems 25

Personal Computing, Distributed Computing, and Client/Server Computing Personal computers Economical enough for individual Popularized by Steve Jobs and Steve Wozniak with the introduction of the Apple in 1977. In 1981 IBM introduced the IBM personal computer using off the shelf components. 26

Machine Languages, Assembly Languages, and High-level Languages Three types of programming languages Machine languages Strings of numbers giving machine specific instructions Example: +1300042774 (these would really be in binary) +1400593419 +1200274027 Assembly languages English-like abbreviations representing elementary computer operations (translated via assemblers) Example: LOAD ADD BASEPAY OVERPAY STORE GROSSPAY 27

Machine Languages, Assembly Languages, and High-level Languages High-level languages Instructions closer to everyday English English is a natural language. Although high level programming languages are closer to natural languages, it is difficult to get too close due to the ambiguities in natural languages (a statement in English can mean different things to different people obviously that is unacceptable for computer programming). However, this is a big research area of computer science. Use mathematical notations (translated via compilers) Example: grosspay = basepay + overtimepay Interpreter Executes high level language programs without compilation. 28

Some Procedural High-level Languages Other high-level languages FORTRAN Used for scientific and engineering applications COBOL Used to manipulate large amounts of data Pascal Intended for academic use 29

The Key Software Trend: Object- Oriented programming (Examples: Java, C++, and Python) Objects Reusable software components that model items in the real world Meaningful software units Date objects, time objects, paycheck objects, invoice objects, audio objects, video objects, file objects, record objects, etc. Any noun can be represented as an object Very reusable More understandable, better organized, and easier to maintain than procedural programming Favor modularity 30

Characteristics of Python Python is simple Python is object-oriented Python is interpreted Python is robust Python is architecture-neutral Python is portable Python is multithreaded Can be applied in all fields (arts and sciences) Python was created by Guido Van Rossum in the 1990 s he named it after Monty Python's Flying Circus comedy program. 31

Basics of a Typical Python Environment 1. Edit Programmer writes program (called source code) and stores program on disk (.py file) 2. Run/Execute Interpreter translates your source code into bytecodes into machine language (interpret will generate a file with.pyc) and then execute the instruction producing the result 32

Another Basic Step for Python Programming Debugging Check program execution and output to ensure program compiles and runs as expected If it doesn t, make corrections in the edit phase and repeat the remaining steps 33