PYTHON PROGRAMMING LANGUAGE.

Slides:



Advertisements
Similar presentations
Python Crash Course by Monica Sweat. Python Perspective is strongly typed, interpreted language is used to define scripts (Don't even need to define a.
Advertisements

Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer 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.
Python Introduction.
Computer Science 101 Introduction to Programming.
Python.
Hello AP Computer Science!. What are some of the things that you have used computers for?
Python Programming Fundamentals
Introduction to Python
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 9, 2015)
Introduction to Computational Linguistics Programming I.
PYTHON. Python is a high-level, interpreted, interactive and object- oriented scripting language. Python was designed to be highly readable which uses.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Hey, Ferb, I know what we’re gonna do today! Aims: Use formatted printing. Use the “while” loop. Understand functions. Objectives: All: Understand and.
Python – May 11 Briefing Course overview Introduction to the language Lab.
Intro to Python Adriane Huber Debbie Bartlett Python Lab #1Python Lab #1 1.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
PROGRAMMING IN R Introduction to R. In this session I will: Introduce you to the R program and windows Show how to install R Write basic programs in R.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
A Python Tour: Just a Brief Introduction "The only way to learn a new programming language is by writing programs in it." -- B. Kernighan and D. Ritchie.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Thinking about programming
Fundamentals of Programming I Overview of Programming
Whatcha doin'? Aims: To start using Python. To understand loops.
A Python Tour: Just a Brief Introduction
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2017
A Playful Introduction to Programming by Jason R. Briggs
GCSE COMPUTER SCIENCE Practical Programming using Python
Introduction to Python
The Python interpreter
Lesson 1 An Introduction
IF statements.
Variables, Expressions, and IO
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during.
Functions CIS 40 – Introduction to Programming in Python
1 Python Lab #1 Intro to Python Adriane Huber Debbie Bartlett.
Do you know this browser?...
Perl for Bioinformatics
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
The Python interpreter
An Introduction to Python
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Python Lessons 13 & 14 Mr. Kalmes.
Passing Parameters by value
BSc in Digital Media, PSUIC
Loops CIS 40 – Introduction to Programming in Python
A look at Python Programming Language 2018.
Python programming exercise
Introduction to Programming with Python
Introduction In today’s lesson we will look at: why Python?
Python Basics with Jupyter Notebook
Experiment No. (1) - an introduction to MATLAB
Introduction to Python
Python Inputs Mr. Husch.
Methods/Functions.
The Python interpreter
L L Line CSE 420 Computer Games Lecture #3 Introduction to Python.
Programming for Business Computing Introduction
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

PYTHON PROGRAMMING LANGUAGE

Python is a general-purpose interpreted, interactive, object- oriented and high-level programming language. Python was created by Guido van Rossum in the late eighties and early nineties. Like Perl, Python source code is also now available under the GNU General Public License (GPL). INTRODUCTION

First download Python exe by following this link. If you are a dialup user, keep in mind that the file is around 10MBPython exe Run the file you just downloaded, and follow the prompts. OK! Hopefully now everything is good! Now, to test if that just worked, type this in your DOS window: python –V INSTALLING PYTHON

Multiplication >>>5*2 10 >>>3**2 9 Division >>>21/7 3 Addition >>>1+1 2 >>> Subtraction >>>6-4 2 MATH IN PYTHON

#Variables Variables store a value, that can be looked at or changed at a later time. #Variable demonstrated print “this program is demo of variables” Print “ the value of v is now ”, v V=v+1 Writing program in python to a file is very easy. Python programs are simply text documents. You can open them up in notepad. #A simple program print “Mary has a little lamb” PROGRAM IN A FILE, AND VARIABLES

The “while” loop a=0 While a<10: a=a+1 Print a LOOPS

Basically, the for loop does something foe every value in a list. The way it is set out is a little confusing, but otherwise is very basic. #cheerleading program Word = raw_input(“ who do you go for? ”) For letter in word: Call = “Gimme a “ + letter + “!” Print call Print letter + “!” Print “what does that spell?” Print word + “!” FOR LOOP

If {conditions to b e met}: {do this} {and this} [but this happens regardless} {because it is not indented} Example1: Y = 1 If y = = 1 Print ‘y still equals 1, I was just checking” CONDITIONAL STATEMENTS

Python has lot of pre- made functions, that you can use right now, simply by ‘calling’ them. ‘Calling’ is a function involves you giving a function input, and it will return a value as output. Here is a general form that calling a function takes. function_name(paramet ers) FUNCTIONS

To open a text file you use, well, the open() function. Seems sensible. You pass certain parameters to open() to tell it in which way the file should be opened –’r’ for read only and –’w’ for writing only, -’a’ for appending and ‘r’+ both reading and writing. Ex- openfile = open(‘pathtofile’, ‘r’) Openfile.read() FILE I/O

ANY QUERY