9
WELCOME TO PYTHON SESSION 2 WELCOME TO PYTHON SESSION 2

Python session 2

Embed Size (px)

DESCRIPTION

Functions and File I/O in python

Citation preview

Page 1: Python session 2

WELCOME TO PYTHON SESSION 2WELCOME TO PYTHON SESSION 2

Page 2: Python session 2

AJENDAAJENDA

FUNCTIONS.

FILES INPUT/OUTPUT (I/O)

Page 3: Python session 2

FUNCTIONSFUNCTIONS

What is Function?

How to define a Function?

How to call a Function?

How to pass an Argument ?

Page 4: Python session 2

FUNCTIONSFUNCTIONS

Function arguments

1. Required arguments.

2. Keyword arguments.

3. Default arguments.

4. Variable-length arguments.

Page 5: Python session 2

FUNCTIONSFUNCTIONS

Scope of variables.

1. Local variable.

2. Global variable.

Page 6: Python session 2

FILE I/OFILE I/O

How to open a file?

What are the attribute using in the file object?

How to close a file?

How to Read and Write a file?

Page 7: Python session 2

FILE I/OFILE I/O

File processing operation using with the os module.

1. Rename ( )

2. Remove ( )

Directories in python.

1. mkdir ( )

2. chdir ( )

3. getcwd ( )

4. rmdir ( )

Page 8: Python session 2

ReferenceReference

http://www.tutorialspoint.com/python/python_functions.htm

Page 9: Python session 2