Tamil Nadu Board of Secondary EducationHSC Science Class 12th

Describe in detail the procedure Script mode programming. - Computer Science

Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads
Answer in Brief

Describe in detail the procedure Script mode programming.

Advertisement Remove all ads


  • Basically, a script is a text file containing the Python statements.
  • Python Scripts are reusable code.
  • Once the script is created, it can be executed again and again without retyping.
  • The Scripts are editable

Creating Scripts in Python:

  • Choose File → New File or press Ctrl + N in the Python shell window.
  • An untitled blank script text editor will be displayed on the screen.
  • Type the code in Script editor
    print(“The Sum=”,c)

Saving Python Script:

  • Choose File →Save or press Ctrl+S
  • Now, Save As dialog box appears on the screen
  • In the Save As dialog box, select the location where you want to save your Python code, and type the File name box Python files are by default saved with extension by Thus while creating Python scripts using Python Script editor, no need to specify the file extension.
  • Finally, ‘click the Save button to save your Python script.

Executing Python Script:

  • Choose Run-Run Module or Press F5
  • If the code has an error, it will be shown in red color in the IDLE window,, and Python describes the type of error that occurred. To correct the errors, go back to the Script editor, make corrections, save the file using Ctrl + S or File→Save and execute it again.
  • For all error-free code, the output will appear in the IDLE window of Python.
Concept: Programming in Python
  Is there an error in this question or solution?


Tamil Nadu Board Samacheer Kalvi Class 12th Computer Science Answers Guide
Chapter 5 Python - Variables and Operators
Evaluation | Q 1. | Page 66

View all notifications

      Forgot password?
View in app×