28.10.2021 Views

Python Tutorial ( PDFDrive )

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Description ............................................................................................. 200

Syntax .................................................................................................... 200

Parameters ............................................................................................. 200

Directive ................................................................................................. 200

Return Value .......................................................................................... 201

Example ................................................................................................. 201

Description ............................................................................................. 202

Syntax .................................................................................................... 202

Parameters ............................................................................................. 202

Return Value .......................................................................................... 202

Example ................................................................................................. 202

Description ............................................................................................. 202

Syntax .................................................................................................... 203

Parameters ............................................................................................. 203

Return Value .......................................................................................... 203

Example ................................................................................................. 203

The calendar Module ............................................................................. 204

Other Modules & Functions: ................................................................... 205

Python Function ..................................................................... 206

Defining a Function ................................................................................ 206

Syntax: ................................................................................................... 206

Example: ................................................................................................ 206

Calling a Function .................................................................................. 207

Pass by reference vs value .................................................................... 207

Function Arguments: .............................................................................. 208

Required arguments: .............................................................................. 208

Keyword arguments: .............................................................................. 209

Default arguments: ................................................................................. 209

Variable-length arguments: .................................................................... 210

The Anonymous Functions: ................................................................... 210

Syntax: ................................................................................................... 211

The return Statement: ............................................................................ 211

Scope of Variables: ................................................................................ 212

Global vs. Local variables: ..................................................................... 212

Python Modules ..................................................................... 213

Example: ................................................................................................ 213

The import Statement: ............................................................................ 213

The from...import Statement .................................................................. 214

The from...import * Statement: ............................................................... 214

TUTORIALS POINT

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!