AD Lab
AD Lab
(Instruction: Rename this file as r-AD Lab-x where r is your roll number & x is your lab. number &
Suppose your roll number is 1905123 & you want to submit lab-2 programs, then file name should be
1905123-AD Lab-2. Finally delete all texts inside parentheses, also parenthesis)
Program Title: Initialize some variables in the python workspace. Now analyze and display what
are variables are created, then delete the single variable as well as all the created
variables.
Input/Output Screenshots:
RUN-1:
Page
Applications Development Laboratory (CS33002), Spring 202
Source code
a = 10
b = 20
c = "Hello, World!"
d = [1, 2, 3, 4]
e = {"key": "value"}
Page
Applications Development Laboratory (CS33002), Spring 202
print("Variables in the workspace:")
del a
del globals()[var]
Program Title: Initialize some variables with different types of value. Now analyze what is the
Input/Output Screenshots:
RUN-1:
Page
Applications Development Laboratory (CS33002), Spring 202
Source code
integer_value = 10
float_value = 20.5
boolean_value = True
complex_value = 3 + 4j
list_value = [1, 2, 3, 4, 5]
tuple_value = (6, 7, 8, 9)
print("Variable Types:")
Program Title: Write an python code to initialize your roll no., name and branch then display all
the details
Input/Output Screenshots:
RUN-1:
Page
Applications Development Laboratory (CS33002), Spring 202
Source code
roll_no = 22051619
name = "Shipra "
branch = "Computer Science"
print("Student Details:")
print(f"Roll Number: {roll_no}")
print(f"Name: {name}")
print(f"Branch: {branch}")
Program Title:Write an python to initialize two variables, then find out the sum, multiplication,
Input/Output Screenshots:
RUN-1:
Source code
num1 = 10
num2 = 5
Page
Applications Development Laboratory (CS33002), Spring 202
if num2 != 0:
else:
print(f"Sum: {sum_result}")
print(f"Multiplication: {multiplication_result}")
print(f"Subtraction: {subtraction_result}")
print(f"Division: {division_result}")
Program Title: Write an python code to enter a 3 numbers from the keyboard, then find out sum
of all the 3 numbers. Write an python code to enter the radius of a circle, then
Page
Applications Development Laboratory (CS33002), Spring 202
Input/Output Screenshots:
RUN-1:
Source code
Page
Applications Development Laboratory (CS33002), Spring 202
Program Title: Write an python code to calculate the compound interest of the given P, T, R
Input/Output Screenshots:
RUN-1:
Source code
CI = P * (1 + R / 100) ** T - P
Program Title: Write an python code to enter two numbers from the keyboard, then swap them
Input/Output Screenshots:
RUN-1:
Page
Applications Development Laboratory (CS33002), Spring 202
Source code
Program Title: Write an python code to enter two numbers and implement all the relational
Input/Output Screenshots:
RUN-1:
Page
Applications Development Laboratory (CS33002), Spring 202
Source code
Program Title: Write an python code to convert given paisa into its equivalent rupee and paisa as
Input/Output Screenshots:
RUN-1:
Source code
Page
Applications Development Laboratory (CS33002), Spring 202
Program Title: Write an python code to convert given second into its equivalent hour, minute
And second as per the following format. Example. 7560 second = 2 Hour, 27
Input/Output Screenshots:
RUN-1:
Source code
minutes = remaining_seconds // 60
seconds = remaining_seconds % 60
Page
Applications Development Laboratory (CS33002), Spring 202
Program Title: Write an python code to convert a quantity in meter entered through keyboard
into its equivalent kilometer & meter as per the following format. Example - 2430
Input/Output Screenshots:
RUN-1:
Source code
Page
Applications Development Laboratory (CS33002), Spring 202
Program Title: A cashier has currency notes of denominations 10, 50 and 100. If the amount to
find the total number of currency notes of each denomination the cashier will
have to give to the with drawer . Ramesh’s basic salary is input through the
keyboard. His dearness allowance is 40% of basic salary, and house rent
allowance is 20% of basic salary. Write an python code to calculate his gross
salary
Input/Output Screenshots:
RUN-1:
Source code
Page
Applications Development Laboratory (CS33002), Spring 202
if amount % 10 != 0:
else:
notes_50 = remaining_amount // 50
remaining_amount %= 50
notes_10 = remaining_amount // 10
Page
Applications Development Laboratory (CS33002), Spring 202
house_rent_allowance = 0.20 * basic_salary
Page