Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 96 - 2615_KEC
P. 96

    Imagine, comments in Python are secret messages from a wise mentor. What advice
                                        or tips would you leave in your code for future programmers to discover?

                             Hashtag

                           #Python: Object-oriented high-level programming language
                           #IDLE: Stands for Integrated Development and Learning Environment

                           REVISIT

                        ▶   Interactive Mode and Script Mode are the two working mode in Python.
                        ▶   The input() function takes the user’s input while a program executes.
                        ▶   The print() function is used to display the content on the screen.
                        ▶   Variables are memory reference points where we store values which can be accessed or changed later.
                        ▶   A data type specifies the type of value a variable can contain.
                        ▶   Comments enable us to understand the way a program works.

                        ▶  Python uses the hash (#) symbol for writing single-line comments.
                        ▶  Python does not have a syntax for multiline comments. To add a multiple-line comment, you could insert a #
                          for each line.
                        ▶   Operators are special symbols which perform computation.

                                                      HANDS-ON PROJECT

                      PROJECT: Number Identification

                      Software Used: CodeSkulptor

                      Objective:
                      Develop a Python program (WAP) to check if a number is:
                          Positive                          Negative                            Zero

                      The program will use:
                          Arithmetic operators
                          Variables and constants

                          Conditional statements (if, elif, else)
                          Formatted outputs

                       94   Premium Edition-VII

| 91 92 93 94 95 96 97 98 99 100 101 |