Python 101 (part 2): If Wishes Were Pythons (
Page 1 of 9 )
Begin your tour of Python with a look at its number and string
types, together with examples of how they can be used in simple Python
programs. Along the way, you'll also learn how to build conditional
expressions, slice and dice strings, and accept user input from the command
lineYou must be tired of hearing this by now - but, since Python is based on an
object-oriented framework, it's only natural that the language contain a
few...well, objects. And over the course of the next few pages, I'm going to
introduce you to two of the most commonly-used basic object types in Python:
numbers and strings.
That's not all, though - I'll also be demonstrating
how to assign values to Python variables on the basis of user input, taking a
long, hard look at the different operations possible with each object type, and
explaining some basic conditional statements. Hang on to your hats, kids...this
is going to be one wild ride!