Everton Aleixo
Fix lang error
e1bcdc1
raw
history blame
No virus
1.74 kB
import streamlit as st
st.markdown(f"## System to Check AnimSchool Grades")
grade1 = st.number_input("Grade for graded assignment 1:")
grade2 = st.number_input("Grade for graded assignment 2:")
grade3 = st.number_input("Grade for graded assignment 3:")
grade4 = st.number_input("Grade for graded assignment 4:")
grade5 = st.number_input("Grade for graded assignment 5:")
clicked = st.button('Check now!')
def get_concept(grade):
if grade >= 93:
return 'A'
if grade >= 90:
return 'A-'
if grade >= 87:
return 'B+'
if grade >= 83:
return 'B'
if grade >= 80:
return 'B-'
if grade >= 77:
return 'C+'
if grade >= 73:
return 'C'
if grade >= 70:
return 'C-'
if grade >= 67:
return 'D+'
if grade > 63:
return 'D'
if grade > 60:
return 'D-'
return 'F'
if clicked:
st.markdown(f"###### The grade for the first assignment was {grade1}. It represents a concept of {get_concept(grade1)}.")
st.markdown(f"###### The grade for the second assignment was {grade2}. It represents a concept of {get_concept(grade2)}.")
st.markdown(f"###### The grade for the third assignment was {grade3}. It represents a concept of {get_concept(grade3)}.")
st.markdown(f"###### The grade for the 4º assignment was {grade4}. It represents a concept of {get_concept(grade4)}.")
st.markdown(f"###### The grade for the 5º assignment was {grade5}. It represents a concept of {get_concept(grade5)}.")
final_grade = (grade1*0.05)+(grade2*0.05)+(grade3*0.1)+(grade4*0.1)+(grade5*0.7)
st.markdown(f"#### The final grade of student is {final_grade}. It represents a concept of {get_concept(final_grade)}.")