Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

Similar documents
Fundamentals of Programming. Lecture 1: Introduction to C Programming

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science

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

Basic Computer Programming for ISNE. Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร

Introduction to Computer Programming for Non-Majors

Introduction to Computers and Visual Basic.Net Pearson Education, Inc. All rights reserved.

C H A P T E R 1. Introduction to Computers and Programming

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components

Introduction. Arizona State University 1

The Programming Process Summer 2010 Margaret Reid-Miller

C++ Programming Language Lecture 1 Introduction

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

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 Programming

SCSP Programming Technique C

Computer Fundamentals

CHAPTER 1: INTRODUCTION TO COMPUTERS AND PROGRAMMING. 1 Muhalim Mohamed Amin Faculty of

Introduction to Computers

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

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

What is the typical configuration of a computer sold today? 1-1

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

Fundamentals of Programming Session 1

CHAPTER 1 Introduction to Computers and Java

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

COMPUTER BASICS Processing/Storage

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

by Pearson Education, Inc. All Rights Reserved.

Elementary Computing CSC M. Cheng, Computer Science 1

CS 241 Computer Programming. Introduction. Teacher Assistant. Hadeel Al-Ateeq

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

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A

Computer Science & Engineering 150A Problem Solving Using Computers

Chapter 1 Introduction to Computers and C++ Programming

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU.

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

Parts of the Computer System. Parts of the Computer System. Parts of the Computer System. Essential Computer Hardware. Information Processing Cycle

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

Chapter 1. Introduction to Programming and Visual Basic Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of

Week 1 Introduction to Programming

0 Introduction: Computer systems and program development

CS150 Introduction to Computer Science 1. What is CS150? Who Are We? CS150 is a programming course You will learn

Intentionally Blank 0

Chapter 1 Introduction to Computers and Programming

Fundamentals of Programming Session 1

An Introduc+on to Computers and Java CSC 121 Spring 2017 Howard Rosenthal

Components of a personal computer

Computer Architecture 2/26/01 Lecture #

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

Zimmer CSCI /24/18. CHAPTER 1 Overview. COMPUTER Programmable devices that can store, retrieve, and process data.

Chapter 1: Introduction

Computer Basics. Lesson 1 Introduction to Computers. Edited by C. Rhodes 08/11

Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Computer Architecture. Fall Dongkun Shin, SKKU

CSC 121 Computers and Scientific Thinking

Computer Organization and Assembly Language (CS-506)

Programming 1 - Honors

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

Problem Solving and Program Design - Chapter 1. Cory L. Strope

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

Computer Organization

Chapter 1. Computer Technology Concept of Programming & Algorithm and Flow Charts

Computer Organization

Computer Programming-1 CSC 111. Chapter 1 : Introduction

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

INTRODUCTION TO THE COURSE

ST. MARY S COLLEGE FORM 4

Computer Architecture and Assembly Language. Spring

Downloaded From :

Fundamentals of Programming Session 2

CC411: Introduction To Microprocessors

Lecture 01: Basic Structure of Computers

Fundamentals of Programming (C)

An Overview of the Computer System. Kafui A. Prebbie 24

INFORMATION COMUNICATION TECHNOLOGY SKS Lecture Two

Information Communications Technology (CE-ICT) 6 th Class

Introduction to Computers

Computer Principles and Components 1

Geographic Information Systems (GIS) - Hardware and software in GIS

Computer Fundamentals

Ms. Minerva A. Lagarde

COMP Computer Basics. Yi Hong May 13, 2015

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

1. A folder inside a folder is called. a) Mini Directory b) Sub Directory c) Root Folder d) Child Folder e) None of these

5 Computer Organization

COMPUTER BASICS LECTURER: ATHENA TOUMBOURI

AN INTRODUCTION TO THE COMPUTER

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

Hardware Revision. AQA Computing AS-Level COMP2. 63 minutes. 60 marks. Page 1 of 24

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Types and Functions of Win Operating Systems

Lecture -1- By lec. (Eng.) Hind Basil University of technology Department of Materials Engineering

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers

Introduction to Java Programming

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

From Algorithms to Architecture....a lightning introduction to computer architecture

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Transcription:

Fundamentals of Programming (Python) Basic Concepts Ali Taheri Sharif University of Technology

Outline 1. What is a Computer? 2. Computer System Organization 3. What is a Computer Program? 4. Programming Languages 5. The Python Language 2

What is a Computer? Device capable of Performing computations Making logical decisions Works billions of times faster than human beings Fastest supercomputers today perform hundreds of billions of additions per second 3

Computer System Organization 4

Computer System Organization The central processing unit (CPU) is the brain of a computer. The CPU carries out all the basic operations on the data. Examples: simple arithmetic operations, testing to see if two numbers are equal. Administrative section of computer Coordinates and supervises other sections 5

Computer System Organization Memory stores programs and data. CPU can only directly access information stored in main memory (RAM or Random Access Memory). Main memory is fast, but volatile, i.e. when the power is interrupted, the contents of memory are lost. Secondary memory provides more permanent storage: magnetic (hard drive), flash (SSD, USB memory), optical (CD, DVD) 6

Computer System Organization Input Device: Receiving section of computer Obtains data from: Usually a keyboard, mouse, disk or scanner Places data at disposal of other units Output Device: Shipping section of computer Puts processed info on: Screens, paper printouts, speakers Makes info available outside the computer 7

Computer System Organization Fetch-Execute Cycle First instruction retrieved from memory Decode the instruction to see what it represents Appropriate action carried out. Next instruction fetched, decoded, and executed. Lather, rinse, repeat! 8

What is a Computer Program? A detailed, step-by-step set of instructions telling a computer what to do. If we change the program, the computer performs a different set of actions or a different task. The machine stays the same, but the program changes! 9

How a Program Runs? Program (in machine language) is loaded to RAM. Program-Counter is set to first instruction. CPU runs each instruction as follows: Fetches instruction determined by Program-Counter and decodes it. Gets the current value of each needed RAM cell, Executes the instruction s function on inputs, Sends the result of instruction s execution to RAM or output devices if needed, Increases Program-Counter to next instruction. 10

Programming Languages Programs expressed in an unambiguous, precise way using programming languages. Every structure in programming language has a precise form, called its syntax Every structure in programming language has a precise meaning, called its semantics. 11

Programming Languages Fall into three categories Machine languages Assembly languages High-level languages 12

Programming Languages Machine Languages Only language understood directly by computer Defined by computer s hardware design Machine-dependent Languages specific to particular computers Incomprehensible to human readers Streams and numbers Ultimately reduced to 0s and 1s Instruct most elementary of operations Slow, tedious and error-prone Led to Assembly languages 13

Programming Languages Assembly Languages English-like abbreviations Represent elementary operations of computer Translated to machine language Assemblers convert to machine language High-speed conversion More clear to human readers Still tedious to use Many instructions for simple tasks Led to high-level languages 14

Programming Languages High-Level Languages Single statements accomplish substantial tasks Translated to machine language Compilers and Interpreters convert to machine language Conversion takes considerable time Instructions comprehensible to humans Look like everyday English Contain common mathematical notation 15

Programming Languages Compiling vs. Interpreting Once program is compiled, it can be executed over and over without the source code or compiler. If it is interpreted, the source code and interpreter are needed each time the program runs. Compiled programs generally run faster since the translation of the source code happens only once. But as compiled program is in system language, the compiled program could be ran just on a specific kind of platform. 16

The Python Language Created by Guido van Rossum Starting development on Dec, 1989 First public version released on Feb, 1991 Created as a scripting language for administrative tasks Based on All Basic Code (ABC) and Modula-3 Part of the open-source community Growing community of Python developers Evolved into well-supported programming language 17

The Python Language Mixture of compilation and interpretation After development, the code, would be compiled to bytecode (a middle language), and so is portable. In running, bytecode would be interpreted to machine. Machine runs the program (which is in machine language). 18

The Python Language Designed to be portable and extensible Originally implemented on UNIX Programs often can be ported from one operating system to another without any change Syntax and design promote good programming practices and surprisingly rapid development times Simple enough to be used by beginning programmers Powerful enough to attract professionals Python is still being updated Last version: 3.6, released on Dec, 2016 19