Page 126 - Computer Science Class 11 Without Functions
P. 126
We also avoid too long names such as roll_Number, student_Name, and student_Marks, unless
necessary to make the context clear.
● The identifiers are case-sensitive. So, name, Name, and NAME are three distinct identifiers.
● An identifier must be different from any of the keywords in the Python language.
● Blank spaces within an identifier are disallowed.
● The special symbols, such as !, @,#,$,%,^,&,*,(,), cannot be included in an identifier.
In this book, we prefer to use the variable names in camelCase. Thus, we capitalize the first letter of every logically
meaningful part of a variable name. For example, we prefer to use the variable name rollNo, instead of the variable
name rollno, which is harder to read. Some people prefer to use an underscore character to separate different
logically meaningful parts of a variable name. Thus, it is also fine to use the variable name roll_no instead of rollNo.
However, it is good practice to adopt a style and stick to it.
6.2.3. Literals
A literal refers to a constant or a fixed value. For example, 100 and 67.24 are numeric literals, 'India', and
"Govt SR Secondary School" are string literals. Consider the following statements:
num = 100 (num is assigned the numeric literal 100)
country = 'India' (country is assigned the string literal 'India')
average = 67.24 (average is assigned floating-point literal 67.24)
A string literal is typically enclosed within single quotes or double quotes. Python allows multi-line strings. A multi-
line string is enclosed in triple quotes, for example:
'''Rashmeet Kaur
Airforce School, Patiala
Punjab'''
6.2.4 Delimiters
Delimiters are symbols used to separate various tokens in a statement. Python uses the following delimiters:
( ) [ ] { }
, : . ; @ = ->
+= -= *= /= //= %= @=
&= |= ^= >>= <<= **=
The last two rows in the above list include delimeters, which are also operators. In addition to the above list, the
following characters have special meaning as part of other tokens:
' " # \
6.2.5 Operators
Operators are tokens that perform a particular operation on the given values, called operands. An operand may be a
constant or a variable.
>>> 20 + 30 # Addition operation: +
50
>>> 5.3 * 40 # Multiplication operation: *
212.0
Table 6.3 shows some of the commonly used operators in Python. You will learn about operators in detail in the next
chapter.
124 Touchpad Computer Science-XI

