O'Reilly logo

Introduction to Python® Programming and Developing GUI Applications with PyQT by B. M. Harwani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Functions and Modules

This chapter covers the following:

  • Creating and using functions

  • Using default value parameters and keyword arguments

  • Using local and global variables

  • Creating lambda functions

  • Applying functions to the sequences

  • Using function attributes

  • Implementing recursion

  • Using iterators, generators, and generator expressions

  • Importing and using modules

  • Using command-line arguments

Let us begin the chapter with functions and their statements.

Functions

A function is a group of statements that can be invoked any number of times. Besides the built-in functions, you can define your own functions. The statement that invokes a function is known as a function call. In calling a function, you can pass arguments to it to perform the desired computation. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required