<jupyter_start><jupyter_text>**<NAME>20bcs133 oops assignment**  problem no. 1<jupyter_code>class Circle:
  def __init__(self,radius):
      self.radius=radius
  
  def area(self):
    ar=3.14*(self.radius)**2
    return ar
  def perimeter(self):
    peri=2*3.14*self.radius
    return peri
A=Circle(5)
print(A.area(),A.perimeter())<jupyter_output><empty_output><jupyter_text>problem no.2<jupyter_code>class Faculty:
  def __init__(self):
    self.name=0
    self.emp_id=0
    self.branch=0
    self.salary=0
  
  def takedetails(self,x):
    print("Faculty",x)
    self.name=input("Enter your name please")
    self.emp_id=input("Enter your Employ id")
    self.branch=input("Entered your branch ")
    self.salary=int(input("Entered your salary"))
     
  def get(self,j):
    print('Details of faculty {}\nName = {}  \nEmp_id = {} \nBranch = {} \nSalary = {}'.format(j,self.name,self.emp_id,self.branch,self.salary))
for x in range(0,5):   
     t1=Faculty()
     t1.takedetails(x+1)
     print(t1.get(x+1))<jupyter_output><empty_output><jupyter_text>problem no.3<jupyter_code>class Bank:
  def __init__(self,Account_no,Name,Amount=0):
    self.Account_no=Account_no
    self.Name=Name
    self.Amount=Amount
  def Deposit(self):
    cash=int(input("Entered the amount to deposit"))
    self.Amount=cash
    print("Amount = {} is succesfully deposited\n".format(self.Amount))
  def Withdraw(self):
    debit=int(input("Entered the amount to withdraw"))
    if(self.Amount>debit):
      self.Amount=self.Amount-debit
      print("your account balance after withdraw = {} \n".format(self.Amount))
    else:
      print("sorry your account balance is lower than withdraw amount")
  def checkbalance(self):
    print("your account balance of {} is {}\n".format(self.Name,self.Amount))
  def details(self):
    print("Name = {}\nAccount no. = {}\nAmount = {}".format(self.Name,self.Account_no,self.Amount))
a1 = Bank("12332","<NAME>",0)
a1.Deposit()
a1.Withdraw()
a1.details()<jupyter_output><empty_output><jupyter_text>problem no. 4<jupyter_code>class Student:
  
  def __init__(self,Name,USN):
    self.Name=Name
    self.USN=USN
    self.Marks=0
  def marks(self):8

    self.Marks=[int(input("Entered the marks of sub 1")),
             int(input("Entered the marks of sub 2")),
             int(input("Entered the marks of sub 3"))]

  def display(self):
    print("Name = {}\nUSN = {}\n".format(self.Name,self.USN)+"Mark of sub ",self.Marks)
s1 = Student("<NAME>",1224)
s1.marks()
s1.display()<jupyter_output><empty_output><jupyter_text>problem no.5<jupyter_code>import sqlite3
conn = sqlite3.connect(':memory:')
c = conn.cursor()
c.execute("""CREATE TABLE patient(name text,date_add text,symptoms text,oxygen integer,date_dis text)""")
#nop = 0
class Patient:
  
  def __init__(self,name,date_add,symptoms,oxygen,date_dis):
    self.name=name
    self.date_add=date_add
    self.symptoms=symptoms
    self.date_dis=date_dis
    self.oxygen=oxygen
  def getdetails(self):
    print("Name = {} \nDate of Addmission = {} \nSymptoms = {} \nOxygen = {} \nDate of Discharge = {}".format(self.name,self.date_add,self.symptoms,self.oxygen,self.date_dis))
  def sendinfo(self):
    c.execute("INSERT INTO patient VALUES (?,?,?,?,?)",(self.name,self.date_add,self.symptoms,self.oxygen,self.date_dis))
    conn.commit()
  def o2_req(self):
    if(self.oxygen<90):
      print("Need to Puton the on Oxygen Support")
    else:
      print("Move to the gernal ward")
def search(oxy):
  c.execute("SELECT * FROM patient WHERE oxygen=?",(oxy,))
  print(c.fetchall())  
  conn.commit()
def sdate(date):
  c.execute("SELECT * FROM patient WHERE date_dis=?",(date,))
  print(c.fetchall())
  
  conn.commit()
def discharge(Name):
  c.execute("DELETE FROM patient WHERE name=?",(Name,))
  conn.commit()
#def no_patient():
  #print(no)


p1 = Patient("hello","27.3.19","cough breathless","1200","29.3.19")
p2 = Patient("aman","24.3.19","cough breathless","1250","27.4.19")
p3 = Patient("anmol","2.3.19","cough breathless","1220","27.4.19")
p4 = Patient("anand","21.3.19","cough breathless","1250","27.4.19")
p1.sendinfo()
p2.sendinfo()
p3.sendinfo()
p4.sendinfo()
sdate("27.4.19")
discharge('anand')
sdate("27.4.19")
search(1250)
conn.close()<jupyter_output><empty_output><jupyter_text>problem no.6<jupyter_code>class Time:
  def __init__(self,Hour,Minutes,Seconds):
    self.Hour=Hour
    self.Minutes=Minutes
    self.Seconds=Seconds
  def __init__(self,Hour,Minutes,Seconds):
    self.Hour=Hour
    self.Minutes=Minutes
    self.Seconds=Seconds

  def show(self):
    print("{}:{}:{}".format(self.Hour,self.Minutes,self.Seconds))
t1=Time(12,34,56)
t1.show()<jupyter_output><empty_output><jupyter_text>problem no. 7<jupyter_code>class Student:
  def __init__(self,Name,Roll_no,Age):
    self.Name=Name
    self.Roll_no=Roll_no
    self.Age=Age
s1=Student("Rahul",21,33)
s2=Student("Rohit",22,74)
def comp(a1,a2):
  if(a1==a2):
    print("Ages are not equal")
  else:
    print("Ages are not equal")
comp(s1.Age,s2.Age)<jupyter_output><empty_output><jupyter_text>problem no. 8<jupyter_code>conn =  sqlite3.connect('student1.db')
stu = conn.cursor()
#stu.execute("""CREATE TABLE student(name text,usn integer,sem text,institue_details text)""")


class Students:
  def __init__(self,name,usn):
    self.sem=1
    self.institute_details=0
    self.name=name
    self.usn=usn
  def create(self):
    stu.execute("INSERT INTO student VALUES (?,?,?,?)",(self.name,self.usn,self.institute_details,self.sem))
    conn.commit()
  def getdetails(self):
    print("Name = {} \nUSN = {} \nSEM = {} \nINSTITUTE_DEATILS = {} \n".format(self.name,self.usn,self.sem,self.institute_details))
  def update(self):
    self.sem=input(" Enter the sem details if the student")
    self.institute_details=input(" Enter the institute details ")
  def info(self,usn):
    stu.execute("SELECT * FROM student WHERE  usn=?",(usn,))
    print(stu.fetchall())
    conn.commit()

#s1=Students("vinayak ",88295)
#s1.update()
#s1.getdetails()
#s1.create()
s1.info(88294)
s1.info(88293)
s1.info(88295)<jupyter_output><empty_output><jupyter_text>problem no. 9<jupyter_code>class Students:
  def __init__(self,Name,Roll_no,Sem):
    self.Name=Name
    self.Roll_no=Roll_no
    self.Sem=Sem
  def details(self):
    print("Name = {}\nRoll_no = {}\nSem = {}".format(self.Name,self.Roll_no,self.Sem))

  def check(self):
    laptop=input("have you a laptop type YES OR NO ")
    if(laptop=="YES" or "yes"):
      class Laptop:     
        def cpu(self):
          print("cpu with i7 processor")
        def display(self):
          print("display are fully touched")
      L1=Laptop()
      L1.cpu()
      L1.display()
    else:
      print("he does not have a laptop")
s1= Students("<NAME>","20bcs133",2)
s1.details()
s1.check()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1686746987951807, 'fraction_numerical': 0.030561269468116367, 'mean_word_length': 4.467469879518072, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '411508', 'license': 'MIT', 'n_tokens_mistral': 2706, 'n_tokens_neox': 2573, 'n_words': 441, 'path': 'OOPs_assignment2.ipynb', 'repo_name': 'Tarunvats9068/oops_with_python', 'size': '6830'}