Introduction to Programming Using Python PART 1

Slides:



Advertisements
Similar presentations
 2005 Pearson Education, Inc. All rights reserved Introduction.
Advertisements

1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
CMT Programming Software Applications
Outline Java program structure Basic program elements
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
 2003 Prentice Hall, Inc. All rights reserved. Customized by Sana Odeh for the use of this class. 1 Introduction to Computers and Programming in JAVA.
Introduction to Python
Chapter 2 Writing Simple Programs
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to Python Programming Outline 2.1 Introduction 2.2 First Program in Python: Printing.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Munster Programming Training
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
CPTR 124 Review for Test 1. Development Tools Editor Similar to a word processor Allows programmer to compose/save/edit source code Compiler/interpreter.
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Input, Output, and Processing
Board Activity Find your seat on the seating chart Login – Remember your login is your first initial your last name and the last three numbers of your.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
Ch13-1 Chap 13 Introduction to Matlab 13.1 Introduction MATLAB : The MATrix LABoratory program Not only is the MATLAB programming language exceptionally.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
9/2/2015BCHB Edwards Introduction to Python BCHB524 Lecture 1.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
PHP using MySQL Database for Web Development (part II)
Chapter 2 Writing Simple Programs
Numbers in ‘C’ Two general categories: Integers Floats
Fundamentals of Programming I Overview of Programming
C++ First Steps.
More about comments Review Single Line Comments The # sign is for comments. A comment is a line of text that Python won’t try to run as code. Its just.
Topics Designing a Program Input, Processing, and Output
Introduction to Python
Lecture 1 Introduction Richard Gesick.
Introduction to the C Language
Introduction to Python
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Programming Basics Web Programming.
Introduction to Python
Data types and variables
Variables, Expressions, and IO
Functions CIS 40 – Introduction to Programming in Python
Introduction to Programming
INTRODUCTION c is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs.
Introduction to the C Language
JavaScript an introduction.
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
Introduction to the C Language
Chapter 10 Programming Fundamentals with JavaScript
Introduction to Python
Python Programming Language
Units with – James tedder
Units with – James tedder
Introduction to Programming Using Python PART 2
Topics Designing a Program Input, Processing, and Output
Section 1 Introduction To Programming
Focus of the Course Object-Oriented Software Development
WEEK-2.
Programming Introduction to C++.
Topics Designing a Program Input, Processing, and Output
Python Programming Language
Experiment No. (1) - an introduction to MATLAB
Topics Designing a Program Input, Processing, and Output
Introduction to Python
12th Computer Science – Unit 5
Introduction to Computer Science
Python Programming Language
Computer Programming-1 CSC 111
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Introduction to Programming Using Python PART 1 MIS 201 Management Information Systems Lab Session 1

Outline Why programming? Python basics: comments, numbers, strings, and variables Operations and expression: logical operators, order of execution, and expressions Control flow: conditional execution using “if” statements

Why Programming? Steve Jobs once said, "Everybody […] should learn how to program a computer... because it teaches you how to think." Software and applications are everywhere! Operating systems (Windows, MacOS, Android, iOS, etc.) Business or home solutions/software Enterprise applications Mobile apps (smartphones, tablets, etc.) Internet of Things (IoT) Cars, smart homes, security systems, etc. Reference: https://www.entrepreneur.com/article/289248

Why Programming? Three Reasons Why Everyone Should Learn Programming Coding develops structured and creative thinking Break every problem down to bits and understand better. You start thinking logically, and this gives rise to more creative solutions… Programming makes things easier for you Turn manual tasks into automated tasks to simplify the work. Learning to program teaches you persistence When you learn computer programming, you start seeing problems in the light of solutions. Your brain starts functioning in that way… Programmers have to think logically about a problem… Reference: https://www.entrepreneur.com/article/289248

A Map of Programming Languages

Python Overview Python is one of those rare languages which can claim to be both simple and powerful. Python is: Simple Easy to learn Free and Open Source High-level Language Portable Interpreted Object Oriented Extensible Embeddable Extensive Libraries

Python Basics Comments Using the sign # in the beginning of lines Numbers Integers: 1, 53, or 3921 Floats: 4.92 scientific format 52.3E-4 = 52.3*10-4 = 0.00523 Strings Single and double quotes Triple quotes (multiple lines) String format method age = 20 name = 'Swaroop’ print('{0} was {1} years old when he wrote this book'.format(name, age)) print('Why is {0} playing with that python?'.format(name)) Output: Swaroop was 20 years old when he wrote this book Why is Swaroop playing with that python?

Python Basics Variables The first character of the identifier must be a letter or an underscore (_) The rest of the identifier name can consist of letters, underscores (_), or digits (0-9) Identifier names are case-sensitive. Examples of valid identifiers: Name name_2_3 Invalid (why?): 2things my-name a1b2&c3

Python Basics Indentation Whitespaces (a space or a tab) are important in Python. A space at the beginning of the line is called indentation. Leading whitespace at the beginning of the logical line is used to determine the indentation level of the logical line, which in turn is used to determine the grouping of statements.