-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent.py
25 lines (25 loc) · 910 Bytes
/
student.py
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
students = {
"anuja": {"roll_number": 45, "marks": 85},
"Raju": {"roll_number": 64, "marks": 92},
"teju": {"roll_number": 25, "marks": 78},
"pallu": {"roll_number": 67, "marks": 90},
"varshi": {"roll_number": 56,"marks": 30}}
def calculate_result(marks):
if marks >= 60:
return "Pass"
else:
return "Fail"
def display_student_info(student_name):
if student_name in students:
student_info = students[student_name]
roll_number = student_info["roll_number"]
marks = student_info["marks"]
result = calculate_result(marks)
print(f"Name: {student_name}")
print(f"Roll Number: {roll_number}")
print(f"Marks: {marks}")
print(f"Result: {result}")
else:
print("Student not found.")
student_name = input("Enter the name of the student: ")
display_student_info(student_name)