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 2. Getting Wet in Python

This chapter covers the following:

  • Performing Arithmetic Operations

  • Using Escape Sequences

  • Displaying Octal and Hexa Values

  • Performing Bitwise Operations

  • Using Complex Numbers

  • Making Decisions: if...else Statement

  • Using Loops: while and for Loops

  • Breaking and Continuing a Loop

  • Using Operators: Logical Operators and Membership Operators

Performing Arithmetic Operations

Arithmetic operators play a major role in programming, and it is essential to understand the use of different operators for efficient programming. Python provides several arithmetic operators for performing different operations on numerical data. The list of arithmetic operators used in Python is shown in Table 2.1.

Table 2.1. Arithmetic Operators

Operation

Description ...

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