FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
devskill-python-course/Basic Python/Problem3.py at master · maf345/devskill-python-course · GitHub
maf345
/
devskill-python-course
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
devskill-python-course
/
Basic Python
/
Problem3.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (35 loc) · 1.31 KB
Breadcrumbs
devskill-python-course
/
Basic Python
/
Problem3.py
Copy path
File metadata and controls
46 lines (35 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# Problem Statement:
# Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer.
# Calculate TOTAL percentage(Not Each subject) and grade according to following:
# Percentage >= 90% : Grade A
# Percentage >= 80% : Grade B
# Percentage >= 70% : Grade C
# Percentage >= 60% : Grade D
# Percentage >= 40% : Grade E
# Percentage < 40% : Grade F
# Assume Each exam has 100 marks in total.
# Taking input of 5 subjects marks-
p
=
float
(
input
(
"Enter marks in Physics: "
))
c
=
float
(
input
(
"Enter marks in Chemistry: "
))
b
=
float
(
input
(
"Enter marks in Biology: "
))
m
=
float
(
input
(
"Enter marks in Math: "
))
i
=
float
(
input
(
"Enter marks in Computer: "
))
TOTAL_marks
=
p
+
c
+
b
+
m
+
i
print
(
f'Total Marks is:
{
TOTAL_marks
}
'
)
# Since each subject has 100 marks. So, 5 subjects will have a total of 500 marks.
# Calculating total Percentage-
TOTAL_percentage
=
(
TOTAL_marks
*
100
)
/
500
print
(
f'Total Percentage is:
{
TOTAL_percentage
}
'
)
# Calculating Grade-
if
TOTAL_percentage
>=
90
:
print
(
"Final Grade is: A"
)
elif
TOTAL_percentage
>=
80
:
print
(
"Final Grade is: B"
)
elif
TOTAL_percentage
>=
70
:
print
(
"Final Grade is: C"
)
elif
TOTAL_percentage
>=
60
:
print
(
"Final Grade is: D"
)
elif
TOTAL_percentage
>=
40
:
print
(
"Final Grade is: E"
)
else
:
print
(
"Final Grade is: F"
)
Back
|
FazBrowse Home
|
New Git URL