-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReport_Card_Printer.py
More file actions
50 lines (44 loc) · 1.36 KB
/
Copy pathReport_Card_Printer.py
File metadata and controls
50 lines (44 loc) · 1.36 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
"""Simple Report Card Printer"""
print("Welcome to the Report Card Printer".center(45))
# Student Information
name = 'Avgarcia'
student_id = 'STU-001'
grade_level = '10th Grade'
# Display student info with type checking
print("\n" + "="*45)
print("STUDENT INFORMATION".center(45))
print("="*45)
print(f"Name: {name}")
print(f" Type: {type(name).__name__}, isinstance(str): {isinstance(name, str)}")
print(f"ID:{student_id}")
print(f"Type:{type(student_id).__name__}, isinstance(str): {isinstance(student_id,str)}")
print(f"Grade: {grade_level}")
print(f" Type: {type(grade_level).__name__}, isinstance(str): {isinstance(grade_level, str)}")
# Grades (Subject: Score)
grades = {
'Mathematics': 85.5,
'English': 92,
'Science': 88.5,
'History': 79,
'Physics': 91,
'Chemistry':100,
'Programming':85,
'Portuguese': 75,
}
print("\n" + "="*45)
print("GRADES".center(45))
print("Report CARD".center(45))
print("="*45)
print(f"Name:{name} | ID:{student_id} ")
print(f"Grade Level: {grade_level}")
print("-"*45)
print(f"{'Subject':<20} {'Score':<10}")
print("-"*45)
for subject, score in grades.items():
print(f"{subject:<20} {score}")
# Calculate average
average = sum(grades.values()) / len(grades)
print("-"*45)
print(f"{'AVERAGE:':<20} {average:.2f}")
print(f" Type: {type(average).__name__}, isinstance(float): {isinstance(average, float)}")
print("="*45)