Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions bankaccount.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
class BankAccount:
def __init__(self, accountNumber, name , balance):
self.accountNumber = accountNumber
self.name = name
self.balance = balance


def deposit(self, d):
self.balance += d


def withdrawal(self, w):
if w > self.balance:
print("Impossible operation! Insufficient balance!")
else:
self.balance -= w

def bankFees(self):
return self.balance - self.balance*0.05

def display(self):
print(f"""
Name: {self.name}
Account Number:{self.accountNumber}
Balance : {self.balance}

""")

Account1 = BankAccount('NL20 503 8675 30 12', 'Richman', 600000)

Account1.deposit(5000)
Account1.withdrawal(10000)
Account1.bankFees()
Account1.display()











25 changes: 25 additions & 0 deletions rectangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Rectangle:
def __init__(self, lenght, width):
self.lenght = lenght
self.width = width

def perimeter(self):
return 2*(self.lenght + self.width)

def area(self):
return self.lenght*self.width

def display(self):
print(f"""
Lenght: {self.lenght}
Width: {self.width}
Perimeter: {self.perimeter()}
Area: {self.area()}


""")

Rectangle1 = Rectangle(15,5)
Rectangle1.display()


51 changes: 51 additions & 0 deletions school.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
class FenyxSchool:

def __init__(self, capacity):
self.capacity = capacity
self.students = []

def add_student(self, std):
if len(self.students) >= self.capacity:
print("There is no place because of capacity of school is full!")
else:
self.students.append(std)

def print_students(self):
for std in self.students:
print(std)



class Student:
def __init__(self, name, age, gender):
self.name = name
self.age = age
self.gender = gender

def __str__(self):
return f"""
Student Name: {self.name}
Student Age: {self.age}
Student Gender: {self.gender}

"""


FenyxSchool = FenyxSchool(2)
student1 = Student("Ahmet", "18", "Boy")
student2 = Student("Suat", "19", "Boy")
student3 = Student("Rana", "18", "Girl")

FenyxSchool.add_student(student1)
FenyxSchool.add_student(student2)
FenyxSchool.print_students()
FenyxSchool.add_student(student3)

print(FenyxSchool.__dict__)