Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 107 - 2615_KEC
P. 107

    Bonus Feature:
                         Decimal Values: Modify the program to accept and calculate side lengths with decimal values

                         for more accuracy.
                         Rounded Output: Display results up to two decimal places to maintain precision.

                          REVISIT

                       ▶   A set of valid characters recognised by a language is called a character set.

                       ▶   A token is the smallest element of a Python program that is meaningful to the interpreter.
                       ▶   Identifiers are the names given to variables, functions and arrays.
                       ▶   Keywords are reserved words that are used for some specific purposes.
                       ▶   Constants or literals are the fixed values that do not change during the execution of a program.
                       ▶   An operator is a symbol that triggers a computation action.
                       ▶   Punctuators are also called separators as they are used to separate lines of codes, variables, etc.
                       ▶   Data types are used to define the type of data.
                       ▶   Integer numbers, floating-point numbers and complex numbers are the built-in numeric data types of
                         Python.
                       ▶   A sequence is an ordered collection of items of similar or different data types.
                       ▶   Boolean is a data type with two built-in values: True or False. They are used in logical evaluation.
                       ▶   Type conversion in Python refers to changing the data type of a variable from one type to another.
                       ▶   Arithmetic  operators  in Python  are used  for performing  mathematical  calculations  such as addition,
                         subtraction, multiplication, and division.
                       ▶   Errors are faults in a program. Errors prevent a program from executing accurately.

                                                       HANDS-ON PROJECT

                     PROJECT: Rectangle Geometry Calculator

                     Software Used: CodeSkulptor

                     Objective:

                     Develop a Python program to calculate the area and perimeter of a rectangle by using:
                         Arithmetic operators

                         Variables and constants

                         Formatted outputs
                     This program will take dynamic input for the length and breadth of the rectangle and display the
                     calculated area and perimeter.

                                                                                        Tokens and Data Types in Python  105

| 102 103 104 105 106 107 108 109 110 111 112 |