Page 115 - Computer Genius Class 08
P. 115

Running a Python Program                                                   Notes

                 Follow these steps to run a Python program:
                                                                             Shortcut key to run the program is F5.



                                             1  Click on Run in the Menu bar.






                       2  Click on Run
                       Module option.




                 The program will execute and the output will be shown in the Shell window.


















                    Unlike Java and C++, Python does not use brackets to delimit code; but indentation is
                    mandatory with Python.


                 Types of Errors

                 Error  is a term used to describe any issue that arises unexpectedly in a computer ,as a result the
                 computer could not function properly. Computers can encounter two types of errors, either software
                 errors or hardware errors.

                 Hardware error: A hardware error is a malfunction of a hardware component such as CPU, RAM
                 etc., in a computer system.
                 Software error: Software errors result due to some fault in a computer program.

                 Types of Errors in Python

                 l  Keyboard Error: Raised when the user presses the interrupt key. [Ctrl+C or delete].

                 l  Indentation Error: Raised when there is an incorrect indentation in a program.
                 l  Import Error: Raised when the imported file is not found.

                 l  Syntax Error: Raised by the parser when syntax is not used properly.

                 l  Name Error: Raised when a variable is not found.




                                                                                            Basics of Python  113
   110   111   112   113   114   115   116   117   118   119   120