DEPARTMENT OF COMPUTER
ENGINEERING
Subject: Python Programming Subject Code: 22616
Semester: 06 Course: CO6I-B
Laboratory No: L001C Name of Subject Teacher: Sangeeta
Wankhede
Name of Student: Suyash Chavan Roll ID: 22203B0047
Experiment No: 02
Title of Experiment: Write simple Python program to display message on screen.
Practical Related Question –
1. List different modes of Programming in Python.
Python offers several modes of programming, each suited to different types of tasks
and problem-solving approaches.
1. Procedural Programming
2. Object-Oriented Programming (OOP)
3. Functional Programming
4. Imperative Programming
5. Event-driven Programming
6. Concurrent Programming
7. Declarative Programming
8. Scripting
9. Reactive Programming.
2. Describe procedure to execute program using Interactive Mode.
To execute a program in Interactive Mode in Python:
1. Open a terminal or command prompt.
2. Type python (or python3 on some systems) and press Enter to start the interactive
shell.
3. Type Python code directly at the >>> prompt and press Enter to execute it.
4. To exit, type exit() or press Ctrl + D (or Ctrl + Z + Enter on Windows).
3. State the steps involved in executing the program using Script Mode.
To execute a program in Script Mode in Python:
1. Create a Python script: Write your Python code in a text editor (e.g., Notepad, VS
Code, or PyCharm) and save it with a .py extension (e.g., program.py).
2. Open a terminal or command prompt.
Page | 1
DEPARTMENT OF COMPUTER
ENGINEERING
3. Navigate to the script's directory: Use cd (change directory) to go to the folder
where the script is saved.
4. Run the script: Type python script_name.py (or python3 script_name.py) and
press Enter.
5. The program will execute and show the output in the terminal.
4. State the procedure to make file executable.
To make a Python file executable:
1. Ensure Python is installed and added to the system's PATH.
2. Save the script with a .py extension (e.g., program.py).
3. Open Command Prompt and run the script using: python program.py.
Exercise –
1. Write a Python program to display your name using Interactive Mode.
Code –
print(“Suyash Chavan”)
Output –
2. Write a Python program to display “MSBTE” using Script Mode.
Code –
pr_01.py:
print("MSBTE")
Output –
Dated signature of Teacher
Marks Obtained
Process Product Total (50)
Related (35) Related (15)
Page | 2
DEPARTMENT OF COMPUTER
ENGINEERING
Page | 3