Skip to Content
Perl To Python Migration
book

Perl To Python Migration

by Martin C. Brown
November 2001
Beginner
320 pages
5h 53m
English
Pearson Business
Content preview from Perl To Python Migration

Chapter 4. COMPONENTS OF A PYTHON PROGRAM

There are three basic components to any language – the statement, the variable and the operator. When migrating from Perl to Python many of the operators and principles are actually the same: we can add two numbers together using +, compare two numbers using ==, and print out information to the screen using print.

However, there are also some differences – we can also concatenate (add) two strings together using the + operator, compare two objects – irrespective of type – using ==, and print is a statement, not a function.

In this chapter we're going to go through the basics of all three elements comparing the Perl versions to their Python equivalents where possible. We'll also look at some of the additional ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl by Example

Perl by Example

Ellie Quigley
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 0201734885Purchase book