Skip to content

Commit 8f77748

Browse files
committed
Content of Class-5 added
1 parent 3e437fd commit 8f77748

File tree

16 files changed

+957
-0
lines changed

16 files changed

+957
-0
lines changed
127 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from rds import Admin
2+
from student import Student
3+
4+
Anik = Student(1410542042,"120120")
5+
Anik.login(1410542042,'120120')
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
all_student_info = {}
2+
class Admin:
3+
def __init__(self,admin_person, admin_id):
4+
self.admin_person = admin_person
5+
self.admin_id = admin_id
6+
def add_info(self, student_name,student_id, semester_name, courses):
7+
"""Adds the info of a student added by the admin person
8+
Input : 'Name of a student' : student_name (str)
9+
'Student ID' : student_id (int)
10+
'Semester Name' : semester_name (str)
11+
'Number of courses' : courses (list)
12+
13+
Output : Returns a Dictionary containing Information for every student added by the admin person
14+
"""
15+
self.student_name = student_name
16+
self.student_id = student_id
17+
student_info = {}
18+
self.semester_name = semester_name
19+
self.courses = courses
20+
if student_id not in student_info:
21+
student_info.update({student_id : {"Student Name" : student_name,"Semester Name" : semester_name,"Courses" : courses}})
22+
23+
else:
24+
print("Student is already added")
25+
all_student_info.update(student_info)
26+
return student_info
27+
28+
def update_cgpa(self,student_id, grades):
29+
"""Updates the info of a student added by the admin person
30+
Input : 'Student ID' : student_id (int)
31+
'Grades of that student' : grades (list)
32+
33+
Output : Returns a Dictionary with the updated Information for every student added by the admin person
34+
"""
35+
/// Your Code Goes Here
36+
def info(self):
37+
38+
return all_student_info
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from rds import Admin
2+
admin_person = Admin("Novish", 250)
3+
admin_person.add_info("Anik", 1410542042, "FALL'14", ["CSE115","MAT116","ENG102"])
4+
admin_person.add_info("Sujit", 1420412042, "SUM'14", ["CSE115","MAT116","ENG102"])
5+
print(admin_person.info())
6+
student_info = admin_person.info()
7+
message = ""
8+
class Student:
9+
def __init__(self, user_name, user_pass):
10+
self.user_name = user_name
11+
self.user_pass = user_pass
12+
def login(self,student_id, user_pass):
13+
if student_id in student_info and self.user_name == student_id and self.user_pass == user_pass:
14+
message = "You have logged in successfully \n"
15+
print(message + "Your Info is : " + str(Admin.info(Admin)[self.user_name]))
16+
else:
17+
print(self.user_name, student_id, self.user_pass, user_pass)
18+
message = "Invalid user_name or password"
19+
print(message + " Please enter valid login credential")
20+
return message
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
class custom_math:
4+
5+
def summation(num1,num2):
6+
return num1+num2
7+
def subtraction(num1,num2):
8+
return num1-num2
9+
def multiplication(num,num2):
10+
return num1*num2
11+
def division(num,num2):
12+
return num1/num2
13+
14+
if __name__ == '__main__':
15+
print(custom_math.summation(5,4))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from custom_math import custom_math
2+
custom_math_operation = custom_math.summation(5,7)
3+
print(custom_math_operation)
4+
5+
6+
# def factorial(number):
7+
# product = 1
8+
# current = 1
9+
# for i in range(0,number):
10+
# product *= current
11+
# current+=1
12+
# # print(product)
13+
# return product
14+
# print(factorial(6))

0 commit comments

Comments
 (0)