An Introduction to Python (TEJ3M & TEJ4M)

Similar documents
Computing and compilers

How to Think Like a Computer Scientist: Learning with Python 3»

Act like a code monkey Coding Basics

Chapter 9. Introduction to High-Level Language Programming. INVITATION TO Computer Science

Programming Fundamentals

CS102 Unit 2. Sets and Mathematical Formalism Programming Languages and Simple Program Execution

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

CSI32 Object-Oriented Programming

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

Programming Languages and Program Development Life Cycle Fall Introduction to Information and Communication Technologies CSD 102

Python The way of a program. Srinidhi H Asst Professor Dept of CSE, MSRIT

PROGRAMMING FUNDAMENTALS

Introduction to Programming: Variables and Objects. HORT Lecture 7 Instructor: Kranthi Varala

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Using loops and debugging code

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

Learning to Program with Haiku

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

Chapter 1: Introduction to Computers and Programming

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

Computer Components. Software{ User Programs. Operating System. Hardware

Basic Concepts. Computer Science. Programming history Algorithms Pseudo code. Computer - Science Andrew Case 2

Software Concepts. It is a translator that converts high level language to machine level language.

Unit E Step-by-Step: Programming with Python

Introduction to computers and Python. Matthieu Choplin

Computer Software: Introduction

Software Development. Integrated Software Environment

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

CMPT 120 Control Structures in Python. Summer 2012 Instructor: Hassan Khosravi

A Set Of Machine Language Instructions For A Program Is Called Source Code >>>CLICK HERE<<<

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

Computer Hardware. Java Software Solutions Lewis & Loftus. Key Hardware Components 12/17/2013

COMP163. Introduction to Computer Programming. Introduction and Overview of the Hardware

Principles of Programming Languages. Lecture Outline

Algorithms and Programming I. Lecture#12 Spring 2015

Computer Fundamentals

Administration Computers Software Algorithms Programming Languages

Programming. leads to programming languages. leads to operating systems

PROBLEM SOLVING AND PYTHON PROGRAMMING

Compilers and Interpreters

Copyright 2005 Department of Computer & Information Science

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

C03c: Linkers and Loaders

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Chapter 1: Why Program? Computers and Programming. Why Program?

DEBUGGING SERIAL COMMUNICATIONS WITH OTHER DEVICES

Lab # 2. For today s lab:

CHAPTER 1 Introduction to Computers and Java

PYTHON YEAR 10 RESOURCE. Practical 01: Printing to the Shell KS3. Integrated Development Environment

Contemporary Multilevel Machines

COMP 102: Computers and Computing

The second statement selects character number 1 from and assigns it to.

Lecture 01 & 02 Computer Programming

Functional Programming in Haskell Prof. Madhavan Mukund and S. P. Suresh Chennai Mathematical Institute

Structured programming

Java Bytecode (binary file)

CISC 124: Introduction To Computing Science II

CPE 101. Overview. Programming vs. Cooking. Key Definitions/Concepts B-1

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

1. What is the minimum number of bits needed to store a single piece of data representing: a. An integer between 0 and 100?

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100

1 Getting used to Python

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Introduction to Programming

St. Benedict s High School. Computing Science. Software Design & Development. (Part 2 Computer Architecture) National 5

Component V Supporting Materials / Learn More Interesting Facts. Interesting Facts

Chapter 11 Introduction to Programming in C

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2016

Computer Components. Software{ User Programs. Operating System. Hardware

Introduction to JAVA

Java and Software Design

Introduction to Computers and Java

Variables and numeric types

GCSE Computer Science Component 02

COP 3402 Systems Software. Lecture 4: Compilers. Interpreters

Pseudocode. 1 Guidelines for writing pseudocode. CS 231 Naomi Nishimura


1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Introduction to Computers and Java

Type Checking and Type Equality

Fundamentals of Programming Session 2

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

4.2 Function definitions the basics

An overview about DroidBasic For Android

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2015

Hands-On Ethical Hacking and Network Defense 2 nd edition

INFS 214: Introduction to Computing

Programming In Java Prof. Debasis Samanta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

COMP Computer Basics. Yi Hong May 13, 2015

Transcription:

An Introduction to Python (TEJ3M & TEJ4M)

What is a Programming Language? A high-level language is a programming language that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages. high-level languages you might have heard of are Turing, Python, C or C++, Java and Perl. programs written in a high-level language have to be translated before they can run which is a small disadvantage of high-level languages.

What is a Programming Language? (continued) Low-level languages, are sometimes called machine language or assembly language. Low-level programs can only run on one kind of computer, and have to be rewritten to run on another. high-level languages are portable, meaning that they can run on different kinds of computers with few or no modifications. almost all programs are written in high-level languages.

What is a Programming Language? (continued) There are two ways to translate a program: interpreting and compiling. An interpreter is a program that reads a high-level program and does what it says, translating the program line-by-line, alternately reading lines and carrying out commands. A compiler is a program that reads a high-level program and translates it all at once, before running any of the commands.

What is a Programming Language? (continued) The compiler translates source code into a language the computer can understand, machine language (the computer understands binary language which are 0 s and 1 s) How it works: 1) Source code is compiled into object code 2) Object code is combined with library files by a linker 3) Produces the file that can be executed by the computer (executable file)

What is a Programming Language? (continued) structured programming is the idea that within a program there are groups of statements that are used to control the flow of information. These groups of statements are called control constructs which consists of: 1) linear sequence: where statements are executed one after the other in the order in which they are written. 2) repetition: where a group of statements is to be executed repeatedly. 3) selection: where one group of statements is selected for execution from a number of alternatives.

What is a Programming Language? (continued) Structured programming refers to a systematic way of analyzing computer problems and designing solutions called top-down programming. In top-down programming, a problem is broken down into a series of smaller problems, each of which is then solved. Once the smaller problems are solved, the solutions are combined to solve the larger problem.

What is a program The instructions look different in different programming languages, but there are a few basic operations most languages perform: 1) input: Get data from the keyboard, or a file, or some other device. 2) output: Display data on the screen or send data to a file or other device. 3) math: Perform basic mathematical operations like addition and multiplication. 4) testing: Check for certain conditions and run the appropriate sequence of statements. 5) repetition: Perform some action repeatedly, usually with some variation.

Debugging programming errors are called bugs and the process of tracking them down and correcting them is called debugging. There are a three kinds of errors that can occur in a program: 1) Syntax Errors 2) Run-time Errors 3) Logic Errors

Syntax Errors Syntax refers to the structure of your program and the rules about that structure. In English, a sentence must begin with a capital letter and end with a period. Compilers are not forgiving. If there is a single syntax error anywhere in your program, the compiler will print an error message and quit, and you will not be able to run your program. The syntax rules are different for various programming languages.

Run-time Errors In Java, run-time errors occur when the interpreter is running the byte code and something goes wrong. Java and Turing tend to be a safe languages, which means that the compiler catches a lot of errors. So run-time errors are rare, especially for simple programs.

Logic Errors If there is a logic error in your program, it will compile and run without generating error messages, but it will not do the right thing. Specifically, it will do what you told it to do. Identifying logic errors can be tricky because you have to work backwards, looking at the output of the program and trying to figure out what it is doing.