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
12 changes: 12 additions & 0 deletions banking_app/login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# login.py - Placeholder for login functionality

def login(username, password):
if username and password is None:
return False
elif username and password is None:
raise ValueError

for i in username:
if i.isdecimal():
raise ValueError

if username not in database.cvs:
return (print("login fails"))

"""
Handles the user login process by verifying the provided username and password.

Expand Down
29 changes: 29 additions & 0 deletions banking_app/signup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# signup.py - Placeholder for signup functionality

def signup(username, password, email):
if username and password and email == None:
raise ValueError

if username in Database_file.csv:
raise ValueError

if len(password) >= 8 :

special = False
lowerCase = False
upperCase = False
num = False

for char in password:
if (char.isdigit()):
num = True
if (char.islower()):
lowerCase = True
if (char.isupper()):
upperCase = True
if (not char.isalnum() and char != ' '):

special = True

return num and lowerCase and upperCase and special

return False


"""
Handles the user signup process by validating the provided username, password, and email.

Expand Down
17 changes: 17 additions & 0 deletions banking_app/transaction.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# transaction.py - Placeholder for transaction functionality

def transact(sender_account, receiver_account, amount):
if sender_account and receiver_account == None:
return False

elif sender_account == receiver_account:
raise ValueError

elif amount <= 0:
raise ValueError

if sender_account and receiver_account not in database:
raise ValueError


if sender_account < amount:
raise ValueError
else:
sender_account -= amount
"""
Handles the transfer of funds between two user accounts.

Expand Down
57 changes: 46 additions & 11 deletions functions_to_test.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,69 @@
# Placeholder functions for Python basics, to be implemented later

def add_numbers(a, b):
pass
return a+b

def find_maximum(a, b, c):
pass
if a > b and c:
return a
elif b > a and c:
return b
else:
return c


def is_palindrome(string):
pass

def count_word_occurrences(text, word):
pass
text = text.lower()
count=0
for i in text:
if i == word:
count+=1
return count

def read_file_lines(filepath):
pass
try:
with open(filepath, "r") as file:
return file

except FileNotFoundError:
return print("FILE NOT FOUND!")



def factorial(n):
pass

def is_prime(n):
pass
if n > 1:
for i in range(2, (n//2)+1):
if (n % i) == 0:
return False
break
else:
return True
else:
return True


def sort_numbers(numbers):
pass

def factorial(n):
pass

n = sorted(numbers)

if (numbers.isdigit()):
return TypeError
else:
return n
def fibonacci(n):
pass
if n == 1:
return 1

if n == 0:
return 0
else:
return fibonacci(n-1) + fibonacci(n-2)


def tower_of_hanoi(n, source, auxiliary, target):

Expand Down