Lab 5, 6
Lab 5, 6
# name=""
# author=""
# edition=0
# copy=4
# def display_detail(self):
# print("name:",self.name)
# print("author:", self.author)
# print("edition :", self.edition)
# def issuance(self):
# print("copy available :", self.copy)
# x = str(input("do you want book : yes or no "))
# if x == "yes" :
# if self.copy >= 0 :
# print("order confirmed ")
# self.copy -=1
# else:
# print(" thank you ")
# def get_info(self):
# self.name=str(input("enter book name "))
# self.author = str(input("enter author name "))
# self.edition = int(input("enter edition: 1,2,3.. "))
# x= str(input("enter password: "))
# if x == "123":
# self.copy= int(input("enter copy available "))
# else:
# print("not valid accseess")
# book1=book()
# book1.get_info()
# book1.display_detail()
# book1.issuance()
#
# class books:
# def __init__(self,name,author,edition,copy):
# self.name=""
# self.author=""
# self.edition=0
# self.copy=4
# def display_detail(self):
# print("name:",self.name)
# print("author:", self.author)
# print("edition :", self.edition)
# def issuance(self):
# print("copy available :", self.copy)
# x = str(input("do you want book : yes or no "))
# if x == "yes" :
# if self.copy >= 0 :
# print("order confirmed ")
# self.copy -=1
# else:
# print(" thank you ")
# def get_info(self):
# self.name=str(input("enter book name "))
# self.author = str(input("enter author name "))
# self.edition = int(input("enter edition: 1,2,3.. "))
# x= str(input("enter password: "))
# if x == "123":
# self.copy= int(input("enter copy available "))
# else:
# print("not valid accseess")
#
# book1=books( "","",0,0)
# book1.get_info()
# book1.display_detail()
# book1.issuance()
# class student:
#
#
# name=""
# id=""
# samaster=0
# year=0
# def display_details(self):
# print("name: ", self.name)
# print("id: ", self.id)
# print("samaster: ", self.samaster)
# print("year: ", self.year)
# def can_pick_up(self):
# if self.samaster=="7" or self.samaster=="8":
# print("you can pick up elective course")
# def samaster_promotion(self):
# if self.samaster < 8:
# print(self.name, "you are promate to next samaster")
# def get_info(self):
# self.name=str(input("Enter your name: "))
# self.id=str(input("Enter your id: "))
# self.samaster=int(input("Enter your samaster: "))
# self.year=int(input("Enter your year: "))
# student1 = student()
# student1.get_info()
# student1.display_details()
# student1.samaster_promotion
#
class students:
def __init__(self,name,id,semester,year):
self.name = name
self.id = id
self.semester = semester
self.year = year
def display_details(self):
print("name: ", self.name)
print("id: ", self.id)
print("semester: ", self.semester)
print("year: ", self.year)
def can_pick_up(self):
if self.semester == 7 or self.semester == 8:
print("you can pick up elective course")
def semester_promotion(self):
if self.semester < 8:
print(self.name, "you are promate to next semester")
a=str(input("Enter your name: "))
b=str(input("Enter your id: "))
c=int(input("Enter your semester: "))
d=int(input("Enter your year: "))
s1=students(a,b,c,d)
s1.display_details()
s1.can_pick_up()
s1.semester_promotion()