Python Programming Practical No.2 answers
Python Programming Practical No.2 answers
y
Practical No. 2: Write simple Python program to display
m
message on screen
de
IX. Conclusion
ca
Ans.
A
We have successfully implemented a simple Python program to display a message
h
on the screen. This practical demonstrates how the print() function works in
Python. It is one of the fundamental commands to output data to the console.
ec
Understanding this basic concept is essential for building more complex programs.
aT
XII Practical Related Questions Note: Below given are few sample questions
m
for reference. Teachers must design more such questions to ensure the
achievement of identified CO.
lo
ip
Ans.
Python supports several modes of programming to cater to various use cases.
These include:
y
Example:
m
python
CopyEdit
de
>>> print("Hello, Python!")
Hello, Python!
ca
○
2. Script Mode: A
○ Python code is written in a script file (e.g., .py) and executed as a
h
whole.
ec
python
CopyEdit
print("This is script mode!")
m
lo
ip
2. State the steps involved in executing the program using Script Mode.
D
Ans.
Here are the steps involved in executing a Python program using Script Mode:
Example:
print("Hello, Script Mode!")
y
2. Open the Terminal or Command Prompt:
m
○ Navigate to the directory where the Python script file is saved.
de
○ Use the cd command to change the directory if needed.
3. Run the Python Script:
ca
Type the following command and press Enter:
python example.py
A
h
○ (Use python3 instead of python if your system requires it.)
ec
Example Output:
lo
print("MSBTE")
D
ip
lo
m
aT
ec
h
A
ca
de
m
y
display information such as physical addresses, phone numbers, emails, or social
media handles. Text inside the <address> tag is often displayed in italic style by
default to differentiate it from regular content.
y
m
de
Created By Mohade Sir and DiplomTech Academy Team
ca
Contact
8261884261
#diplomatechacademy
#indemandsoftwaredevelopers
A
h
ec
aT
m
lo
ip
D