Project File
Project File
E
PYTHON-1 13-08-2024
PYTHON-2 20-08-2024
PYTHON PRACTICAL-
1
A) Install Python and setup development
environment
Step 1: Select Version to Install Python
Visit the official page for
Python https://www.python.org/downloads/ on the
Windows operating system. Locate a reliable
version of Python 3, preferably version 3.10.11,
which was used in testing this tutorial. Choose
the correct link for your device from the options
provided: either Windows installer (64-bit) or
Windows installer (32-bit) and proceed to
download the executable file.
Step 2: Downloading the Python Installer
Once you have downloaded the installer, open
the .exe file, such as python-3.10.11-
amd64.exe, by double-clicking it to launch the
Python installer. Choose the option to Install the
launcher for all users by checking the
corresponding checkbox, so that all users of the
computer can access the Python launcher
application.Enable users to run Python from the
command line by checking the Add python.exe to
PATH checkbox.
Step 3: Running the Executable Installer
After completing the setup. Python will be
installed on your Windows system. You will see a
successful message.
Step 4: Verify the Python Installation in
Windows
Close the window after successful installation of
Python. You can check if the installation of Python
was successful by using either the command line
or the Integrated Development Environment
(IDLE), which you may have installed. To access
the command line, click on the Start menu and
type “cmd” in the search bar. Then click on
Command Prompt.
You can also check the version of Python by
opening the IDLE application. Go to Start and
enter IDLE in the search bar and then click
the IDLE app, for example, IDLE (Python
3.10.11 64-bit). If you can see the Python IDLE
window then you are successfully able to
download and installed Python on Windows.
B) write a program to print hello world
Code:
Print(“Hello world”)
OUTPUT:
C) Write a program to calculate area of circle with
given radius
CODE:
OUTPUT:
PYTHON PRACTICAL-
2
A) Check if the number is odd or even
CODE:
Num=int(input("enter a number: "))
if Num%2==0:
print("number is even"
)
else:
print("number is odd")
OUTPUT:
B) Implement simple calculator
CODE:
Num1=int(input("Enter Number 1: "))
Op=input("Enter an operator: ")
Num2=int(input("Enter Number 2: "))
if Op=="+":
print(Num1+Num2)
elif Op=="-":
print(Num1-Num2)
elif Op=="*":
print(Num1*Num2)
elif Op=="/":
print(Num1/Num2)
else:
print("Invalid Operator")
OUTPUT:
OUTPUT: