Page 57 - Information_Practice_Fliipbook_Class11
P. 57
3 BASICS OF PYTHON
PROGRAMMING
Chapter Outline
3.1 Character Set 3.2 Tokens
3.3 Variables 3.4 Functions
3.5 Be Careful while Naming Variables 3.6 Multiple Assignments
3.7 id() 3.8 L-Value and R-Value
3.9 Comments 3.10 Input and Output
Introduction
In the previous chapter, we introduced Python – a popular high-level programming language that is simple to learn.
In this book, we will use Python to give instructions to the computer to input data, process it, and output the results
in the desired format. A sequence of such instructions forms a program. This chapter will talk about the basics
of the Python programming language, such as the character set, tokens, variables, comments, and input-output
statements.
3.1 Character Set
A character set for a computer programming language is a set of characters available to a programmer for use. Typically,
it consists of lowercase and uppercase alphabets, digits, symbols such as + - * /, [] and white space characters
like blank, end of the line, and tab. Table 3.1 shows the set of characters popularly used in Python.
Table 3.1: Character Set of Python
Letters a-z, A-Z
Digits 0-9
Special symbols ~ ! @ # $ % ^ & * ( ) _ + = - { } [ ] | \ : " ; ' < > ?, . /
White Spaces Blank space, Tab (\t), Carriage return ( ), newline(\n)
Python supports the Unicode encoding standard, which includes all ASCII characters.
Basics of Python Programming 43

