A
PRACTICAL FILE
ON
“PROGRAMMING AND PROBLEM SOLVING”
CODE:
TO
Flora Institute
BE-F.Y
SESSION -2024-25
FLORA INSTITUTE OF TECHNOLOGY
KHOPI, PUNE, MAHARASHTRA
SUBMITTED BY
ROLL NO
Batch In-charge Head of Dept. External Examiner
FLORA INSTITUTE OF TECHNOLOGY
KHOPI, PUNE, MAHARASHTRA
CERTIFICATE
This is to certified that Mr./Mrs.
Of class Roll No., has completed all
the practical work in subject
satisfactorily by in the Department of
as prescribed by the University of Pune, in the academic 2024-2025 .
Remark :
Date:-
Batch In-charge Head of Dept. External Examiner
Sr. Name of practical’s Page Date Sign
no no.
Group - A
Perform all operations (Addition, Multiplication,
Subtraction, Division, Module)
1
2 Operation of List & Tuple
3 Concatenate two strings using '+' operator
4 Use of ord() and chr()
5 String Operations
6 Open a file and print its attribute values
7 Copy file content with modifications
8 Illustrating the use of init method
9 Program in python to determine whether the
person is eligible for vote or not
10 Program to find whether the given number is even
or odd
11 Program to access class variable using class object
Group - B
1 Develop algorithms, draw flow chart, and write a
program to solve electrical network (KVL/KCL) using
python
2 Develop algorithms, draw flow chart, and write a
program for star delta conversion using python
3 Two forces P and Q acting on a body 180 KN and 240
KN respectively. The angle between the two forces
is 60 degrees. Determine the resultant of force P
and Q and it's direction with respect to Q force
4 Assume five liters of Oil weigh 61.80 N. Write a
program to calculate i ) Specific Weight ii) Specific
mass using python.
Hardware Requirements
Component Minimum Requirement Recommended for Smooth Performance
Processor (CPU) 1 GHz or faster Dual-core or higher (e.g., i5, Ryzen 3+)
RAM 2 GB 4 GB or more
Storage 200 MB for Python installation SSD with 10+ GB free for projects
Display Any basic monitor 1366×768 or higher
Software Requirements
Requirement Details
Operating System Windows
Python Version Python 3.x (latest is recommended: 3.10, 3.11, or 3.12)
Python IDE or Editor IDLE (built-in), VS Code, PyCharm,
Package Manager pip (comes with Python)
Tools You May Install
• Python Interpreter
• Code Editor/IDE:
o VS Code (lightweight, free)
o PyCharm (full-featured, great for big projects)
GROUP A
Q9 PROGRAM IN PYTHON TO DETERMINE WHETHER THE PERSON IS ELIGIBLE FOR VOTE OR NOT
Code:
age = int(input("Enter your age: "))
if age >= 18:
print("You are eligible to vote.")
else:
print("You are not eligible to vote yet.")
Output:
Enter your age: 20
You are eligible to vote.
10)Program to find whether the given number is even or odd
Code:
num = int(input("Enter a number: "))
if num % 2 == 0:
print(f"{num} is an even number.")
else:
print(f"{num} is an odd number.")
Output:
Enter a number: 7
7 is an odd number.
11) Program to access class variable using class object
Code:
class Student:
school_name = " Flora Valley School & Junior College "
s1 = Student()
print("School Name:", s1.school_name)
Output:-
School Name: Flora Valley School & Junior College
GROUP B
Q1. Develop algorithms, draw flow chart, and write a program to solve electrical network (KVL/KCL)
using python
Code :-
V = float(input("Enter voltage (V): "))
R1 = float(input("Enter resistance R1 (Ohms): "))
R2 = float(input("Enter resistance R2 (Ohms): "))
I = V / (R1 + R2)
print(f"The current in the circuit is {I:.2f} A")
Output:-
Enter voltage (V): 12
Enter resistance R1 (Ohms): 4
Enter resistance R2 (Ohms): 2
Output:
The current in the circuit is 2.00 A
Q2. Develop algorithms, draw flow chart, and write a program for star delta conversion using python
Code :-
R1 = float(input("Enter Star resistance R1: "))
R2 = float(input("Enter Star resistance R2: "))
R3 = float(input("Enter Star resistance R3: "))
P = R1 * R2 + R2 * R3 + R3 * R1
R_AB = P / R3
R_BC = P / R1
R_CA = P / R2
print("\nEquivalent Delta resistances:")
print(f"R_AB = {R_AB:.2f} ohms")
print(f"R_BC = {R_BC:.2f} ohms")
print(f"R_CA = {R_CA:.2f} ohms")
Output:-
Enter Star resistance R1: 2
Enter Star resistance R2: 3
Enter Star resistance R3: 4
Output:
Equivalent Delta resistances:
R_AB = 4.50 ohms
R_BC = 7.00 ohms
R_CA = 5.25 ohms
Q3. Two forces P and Q acting on a body 180 KN and 240 KN respectively. The angle between the two
forces is 60 degrees. Determine the resultant of force P and Q and it's direction with respect to Q force.
Code :-
import math
P = 180 # in kN
Q = 240 # in kN
theta_deg = 60 # angle in degrees
theta_rad = [Link](theta_deg)
R = [Link](P**2 + Q**2 + 2 * P * Q * [Link](theta_rad))
alpha_rad = math.atan2(P * [Link](theta_rad), Q + P * [Link](theta_rad))
alpha_deg = [Link](alpha_rad)
print(f"Resultant Force (R): {R:.2f} kN")
print(f"Angle with respect to Q: {alpha_deg:.2f} degrees")
Output:-
Resultant Force (R): 389.71 kN
Angle with respect to Q: 30.00 degrees
Q4. Assume five liters of Oil weigh 61.80 N. Write a program to calculate i ) Specific Weight ii) Specific
mass using python.
Code :-
weight = 61.80 # in Newtons
volume_liters = 5
volume_m3 = volume_liters * 0.001 # convert liters to cubic meters
g = 9.81 # acceleration due to gravity in m/s^2
specific_weight = weight / volume_m3 # N/m^3
specific_mass = specific_weight / g # kg/m^3
print(f"Specific Weight: {specific_weight:.2f} N/m³")
print(f"Specific Mass (Density): {specific_mass:.2f} kg/m³")
Output:-
Specific Weight: 12360.00 N/m³
Specific Mass (Density): 1260.57 kg/m³