Skip to content
Programs · Program 5-1

Q.Program 5-1: Write a program to show print statement in script mode.

Chhattisgarh CgbseTextbookSubjective· 2mImportance★★★★★est
4% · 2/49 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Type the print() statements in a file, save it with a .py extension, and run the whole file at once — that is script mode.

The idea. Python offers two ways of working. In interactive mode (the >>> prompt) each statement is executed the moment you press Enter — good for quick experiments, but nothing is saved. In script mode you write all the statements in a text file with the extension .py and execute the file as a unit; the program is saved permanently and can be run any number of times. A "program to show print statement in script mode" is therefore just a saved file of print() statements.

Steps

  1. Open a new file in IDLE (File → New File) or any editor.
  2. Type the program below.
  3. Save it as prog5-1.py.
  4. Run it: in IDLE press F5 (Run → Run Module), or from the command prompt type python prog5-1.py.
# prog5-1.py
# Program to show the print statement in script mode
print("Hello World!")
print("Welcome to Python programming.")

Expected output

Hello World!
Welcome to Python programming.
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.