Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to Introduction to Computers and Programming Course using Python V22.0002, Section 3, Spring 2010 Course Introduction Professor: Sana Odeh

Similar presentations


Presentation on theme: "Welcome to Introduction to Computers and Programming Course using Python V22.0002, Section 3, Spring 2010 Course Introduction Professor: Sana Odeh"— Presentation transcript:

1

2 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 odeh@courant.nyu.edu

3 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

4 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)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

5 4 Course Description 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!

6 5 This is all Computer Science? This is all Computer Science?

7 6 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

8 7 What the class is really about 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

9 8 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

10 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

11 Python is much easier to learn than other programming languages let’s see how can print one line using Python and python what do you think? Python is much easier to learn than other programming languages let’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( String args[] ) { System.out.println(“Hello students and welcome to programming " ); } // end method main } // end class Welcome1 10 # Hello program in Python print (“Hello students and welcome to programming ”)

12 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

13 12 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 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) 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!) 12

14 Administrative Matters 13

15 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

16 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.htmlhttp://openbookproject.net/thinkcs/python/engli sh2e/index.html 15

17 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

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

19 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

20 A Word About Cheating 19 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.Academic Integrity If you are caught cheating, you will receive an immediate FAILURE for the course.

21 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

22 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

23 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 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/. http://www.nyu.edu/cas/clc/ 22

24 23 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

25 24 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

26 25 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

27 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

28 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 BASEPAY ADD OVERPAY STORE GROSSPAY 27

29 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

30 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

31 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

32 31 Characteristics of Python F Python is simple F Python is object-oriented F Python is interpreted F Python is robust F Python is architecture-neutral F Python is portable F Python is multithreaded F 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.Guido Van RossumMonty Python's Flying Circus

33 32 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

34 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


Download ppt "Welcome to Introduction to Computers and Programming Course using Python V22.0002, Section 3, Spring 2010 Course Introduction Professor: Sana Odeh"

Similar presentations


Ads by Google