Python Assignment & Homework Help - PowerPoint PPT Presentation

About This Presentation
Title:

Python Assignment & Homework Help

Description:

Python is Widely used Programming Language nowdays and the University and High School Assignments and Homework are the Part of the Curriculum. So with the help of Online Tutoring Service of myassignmenthelp you can achieve your Goals at the Right Time – PowerPoint PPT presentation

Number of Views:26
Slides: 12
Provided by: myassignmenthelpnet
Tags:

less

Transcript and Presenter's Notes

Title: Python Assignment & Homework Help


1
PYTHON PROGRAMMING LANGUAGE
  • www.myassignmenthelp.net

2
Introduction
  • 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).

3
Installing Python
  • First download Python-2.4.1.exe by following this
    link. If you are a dialup user, keep in mind that
    the file is around 10MB
  • 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

4
Math in python
  • Addition
  • gtgtgt11
  • 2
  • gtgtgt2080
  • 100
  • Subtraction
  • gtgtgt6-4
  • 2
  • Multiplication
  • gtgtgt52
  • 10
  • gtgtgt32
  • 9
  • Division
  • gtgtgt21/7
  • 3

5
Program in a file, and variables
  • 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
  • Vv1
  • 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

6
loops
  • The while loop
  • a0
  • While alt10
  • aa1
  • Print a

7
For Loop
  • 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 !

8
Conditional Statements
  • 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

9
Functions
  • 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(parameters)

10
File I/O
  • 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()

11
Any QUERY www.MYassignmenthelp.net
Write a Comment
User Comments (0)
About PowerShow.com