-
Notifications
You must be signed in to change notification settings - Fork 412
Expand file tree
/
Copy pathpython 1.py
More file actions
64 lines (48 loc) · 1.57 KB
/
Copy pathpython 1.py
File metadata and controls
64 lines (48 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
length = float(input("Enter length: "))
breadth = float(input("Enter breadth: "))
area = length * breadth
print("Area of Rectangle =", area)
p = float(input("Enter Principal Amount: "))
r = float(input("Enter Rate of Interest: "))
t = float(input("Enter Time (years): "))
si = (p * r * t) / 100
print("Simple Interest =", si)
celsius = float(input("Enter temperature in Celsius: "))
fahrenheit = (9/5) * celsius + 32
print("Temperature in Fahrenheit =", fahrenheit)
a = float(input("Enter first number: "))
b = float(input("Enter second number: "))
c = float(input("Enter third number: "))
average = (a + b + c) / 3
print("Average =", average)
num = int(input("Enter a number: "))
square = num ** 2
cube = num ** 3
print("Square =", square)
print("Cube =", cube)
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
a, b = b, a
print("After Swapping:")
print("a =", a)
print("b =", b)
# Student Report Program
# Input student details
name = input("Enter Student Name: ")
roll_no = input("Enter Roll Number: ")
# Input marks
m1 = float(input("Enter marks in Subject 1: "))
m2 = float(input("Enter marks in Subject 2: "))
m3 = float(input("Enter marks in Subject 3: "))
# Calculate total and percentage
total = m1 + m2 + m3
percentage = total / 3
# Display Report
print("\n------ STUDENT REPORT ------")
print("Name :", name)
print("Roll No :", roll_no)
print("Subject 1 :", m1)
print("Subject 2 :", m2)
print("Subject 3 :", m3)
print("Total Marks:", total)
print("Percentage :", percentage, "%")