Introduction to Python Mr E SURESH BABUM TECHCSE

Introduction to Python Mr. E. SURESH BABUM. TECH(CSE). , (Ph. D. ) Associate Professor DST-FIST Sponsored Department College of Engineering K L University, Vaddeswaram I hear and I forget. I see and I remember. I do and I understand.

Outline v Review of Python

If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea Review of Python

History of Python

History of Python 1: 1994 Python 2: 2000 Python 3: 2008 Guido Van Rossum Specifically, we’re using Python 3. 5. 2

Programmers Are More Important Than Programs
![“Hello World” in Java public class Hello. World { public static void main(String[] args) “Hello World” in Java public class Hello. World { public static void main(String[] args)](http://slidetodoc.com/presentation_image_h2/5f869874508ac0f50e370898d9860c49/image-7.jpg)
“Hello World” in Java public class Hello. World { public static void main(String[] args) { System. out. println("Hello World!”); } }

“Hello World” in C++ #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; }

“Hello World” in Python print("Hello world!")

Introduction to Python

Review of Python v Python is one of those rare languages which is simple and powerful. v Using Python, You can concentrate the solution to the given problem rather than syntax and structure of the language (C++ or Java)

Features of Python v Python ü Easy to learn, ü Powerful programming language. ü Efficient high-level data structures ü Simple and Effective Approach (object-oriented programming. )

Features of Python v Python ü High Level Language ü Portable and Interpreted ü Embeddable ü Extensive Libraries

Features of Python v Python ü Supports Elegant Syntax and Dynamic Typing ü Free and Open-Source ü Ideal language for scripting ü Rapid Application development in many areas on most platforms.

Interactive Interpreter

Interactive Interpreter

Comments # Single line comments start with a '#‘ """ Multiline strings can be written using three "s, and are often used as comments """

Variables

Variables v x=2 v x*7 No Semi Colon >>> 14 v x = "Hello, I'm " v x + "Python!" >>> "Hello, I'm Python"

Data Types

Where’s My Type? In Java or C++ int x = 0; In Python x = 0;

Where’s My Type?

Numbers and Math

Where’s My Type?

Control Flow

Control Flow

Control Flow

Control Loops

Control Loops

Control Loops

Functions

Functions

Functions : Example

Thank You
- Slides: 34