0% found this document useful (0 votes)
2 views24 pages

Python Programming Lab Manual

This document is a lab manual for the Python Programming course (11660103) at Rudra Goswami College of Computer Application. It includes a series of programming experiments and projects designed to enhance students' understanding of Python, along with an Anaconda installation guide for setting up the programming environment. The manual serves as a practical resource for students in their sixth semester of the Bachelor of Computer Application program.

Uploaded by

mishrakishang
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views24 pages

Python Programming Lab Manual

This document is a lab manual for the Python Programming course (11660103) at Rudra Goswami College of Computer Application. It includes a series of programming experiments and projects designed to enhance students' understanding of Python, along with an Anaconda installation guide for setting up the programming environment. The manual serves as a practical resource for students in their sixth semester of the Bachelor of Computer Application program.

Uploaded by

mishrakishang
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RUDRA GOSWAMI COLLEGE OF COMPUTER

APPLICATION

BACHELOR OF COMPUTER APPLICATION

MONARK UNIVERSITY

LAB_MANUAL
Semester:6
Python Programming
(11660103)

Python Programming- 11660103 1


RUDRA GOSWAMI COLLEGE OF COMPUTER APPLICATION

BACHELOR OF COMPUTER APPLICATION

CERTIFICATE

The lab manual prepared by for


Python Programming (11660103) for the partial fulfillment of Bachelor of Computer
Application, has been carried out under my supervision in the Department of Computer
Application, Rudra Goswami College of Computer Application. His/Her present work has
been found satisfactory.

Student Enrollment No:

Date of Submission:

Faculty sign

Python Programming- 11660103 2


RUDRA GOSWAMI COLLEGE OF COMPUTER APPLICATION

BACHELOR OF COMPUTER APPLICATION


Subject Name: Python Programming Semester:6th

SubjectCode:11660103 Academicyear:2024

INDEX
[Link] Experiments Date Page Grade Sign
No
1 Write a program that takes an integer
input from the user and converts it to a
float.
2 Write a program that takes two numbers
as input and calculates their sum,
difference, product, and quotient.
3 Implement a program that uses compound
assignment operators to update the values
of variables.
4 Write a Python program that compares
two numbers and prints whether they are
equal, greater, or smaller.
5 Create a program that uses logical
operators to check if a user-entered
number is between 10 and 20.
6 Define a list of your favorite colors. Write a
program that checks if a color entered by
the user is in the list.
7 Write a program that takes a user's age as
input and prints "You are an adult" if the
age is 18 or older.
8 Create a program that checks if a given
number is even or odd and prints the
result.
9 Write a program that prints numbers from
1 to 5 using a while loop.
10 Combine decision-making and loop
structures to create an interactive
program that allows the user to perform
various operations (e.g., addition,
subtraction, multiplication) until they
choose to exit.
11 Create a function that calculates the
volume of a cylinder given its radius and
height. Use a default value for height.

Python Programming- 11660103 3


12 Design a program that calculates the area
of different shapes (circle, rectangle,
triangle) using separate functions for each
shape.
13 Create a program with a global variable
and a function that modifies a local
variable. Discuss the concept of variable
scope.
14 Develop a program that writes binary data
(e.g., images) to a binary file.
15 Develop a program that reads and
processes a large text file in chunks to
optimize memory usage.
16 Integrate the LED blinking, button input,
and sensor programming concepts into a
single MicroPython project (e.g., Smart
Home Automation).
17 Write a Micro Python program to blink an
LED connected to a GPIO pin.
18 Debug a MicroPython program that reads
sensor data and identify and fix any issues.

Python Programming- 11660103 4


Anaconda Installation Guide.
Step 1: Download Anaconda
1. Go to the Anaconda website: Anaconda Download.
2. Choose the appropriate version (Windows, macOS, Linux) for your operating system.
3. Download the installer for the latest version of Anaconda.
Step 2: Install Anaconda
For Windows:
1. Once the installer is downloaded, double-click it to launch the Anaconda installer.
2. Follow the prompts in the installer (you can accept the default settings).
3. At the end of the installation, you may be prompted to add Anaconda to your system PATH
variable. It's recommended to select this option.
4. After installation, you can launch Anaconda Navigator from the Start Menu.
For macOS:
1. Once the installer is downloaded, open the Terminal.
2. Navigate to the directory containing the downloaded installer.
3. Run the following command to execute the installer:

bash Anaconda3-<ver bash Anaconda3-<version>-MacOSX-x86_64.shsion>-MacOSX-x86_64.sh


Replace <version> with the version number of Anaconda you downloaded.
4. Follow the prompts in the installer (you can accept the default settings).
5. After installation, you can launch Anaconda Navigator from the Applications folder.
For Linux:
1. Once the installer is downloaded, open a terminal.
2. Navigate to the directory containing the downloaded installer.
3. Run the following command to execute the installer:
phpCopy code
bash Anaconda3-<version>-Linux-x86_64.sh
Replace <version> with the version number of Anaconda you downloaded.
4. Follow the prompts in the installer (you can accept the default settings).
5. After installation, you can launch Anaconda Navigator from the Applications menu.
Step 3: Launch Anaconda Navigator
1. Open Anaconda Navigator from the Start Menu (Windows) or Applications folder (macOS).
2. Anaconda Navigator is a graphical interface that allows you to manage environments, install
packages, and launch applications.
Step 4: Create a New Environment (Optional)
1. Click on the "Environments" tab in Anaconda Navigator.
2. Click on the "Create" button.
3. Enter a name for your environment, select the Python version, and choose additional packages if
needed.
4. Click on the "Create" button to create the new environment.
Step 5: Launch Jupyter Notebook
1. Click on the "Home" tab in Anaconda Navigator.
2. Select the environment where you want to launch Jupyter Notebook (if you created a new
environment).
3. Click on the "Launch" button under Jupyter Notebook.

Python Programming- 11660103 5


4. This will open Jupyter Notebook in your default web browser, where you can create new
notebooks, write Python code, and run it interactively.
Step 6: Install Packages
1. If you want to install additional packages, you can do so using Anaconda Navigator or the
command line.
2. To install packages using Anaconda Navigator, go to the "Home" tab, select the environment, click
on the "Not installed" dropdown, search for the package you want to install, and click on the
checkbox to install it.
Step 7: Write and Run Python Code
1. Use your preferred text editor or integrated development environment (IDE) to write Python code.
2. Save your Python code with a .py extension.
3. Open a terminal or command prompt and activate the desired environment:
4. Navigate to the directory containing your Python script.
5. Run your Python script using the Python interpreter:

That's it! You've now successfully installed Anaconda and are ready to use it for Python
development. You can manage environments, install packages, and run Python code using
Anaconda Navigator or the command line.

Python Programming- 11660103 6


1 Write a program that takes an integer input from the user and converts it to a float.

Python Programming- 11660103 7


2 Write a program that takes two numbers as input and calculates their sum, difference,
product, and quotient.

Python Programming- 11660103 8


3 Implement a program that uses compound assignment operators to update the values of
variables.

Python Programming- 11660103 9


4 Write a Python program that compares two numbers and prints whether they are equal,
greater, or smaller.

Python Programming- 11660103 10


5 Create a program that uses logical operators to check if a user-entered number is
between 10 and 20.

Python Programming- 11660103 11


6 Define a list of your favorite colors. Write a program that checks if a color entered by the
user is in the list.

Python Programming- 11660103 12


Write a program that takes a user's age as input and prints "You are an adult" if the age is 18 or
7 older.

Python Programming- 11660103 13


Create a program that checks if a given number is even or odd and prints the result.
8

Python Programming- 11660103 14


Write a program that prints numbers from 1 to 5 using a while loop.
9

Python Programming- 11660103 15


Combine decision-making and loop structures to create an interactive program that allows the
10 user to perform various operations (e.g., addition, subtraction, multiplication) until they choose
to exit.

Python Programming- 11660103 16


Create a function that calculates the volume of a cylinder given its radius and height. Use a
11 default value for height.

Python Programming- 11660103 17


Design a program that calculates the area of different shapes (circle, rectangle, triangle) using
1
separate functions for each shape.
2

Python Programming- 11660103 18


Create a program with a global variable and a function that modifies a local variable. Discuss the
13 concept of variable scope.

Python Programming- 11660103 19


Develop a program that writes binary data (e.g., images) to a binary file.
14

Python Programming- 11660103 20


Develop a program that reads and processes a large text file in chunks to optimize memory usage.
15

Python Programming- 11660103 21


Integrate the LED blinking, button input, and sensor programming concepts into a single
16 MicroPython project (e.g., Smart Home Automation).

Python Programming- 11660103 22


Write a Micro Python program to blink an LED connected to a GPIO pin.
17

Python Programming- 11660103 23


Debug a MicroPython program that reads sensor data and identify and fix any issues.
18

Python Programming- 11660103 24

You might also like