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

def login(username, password):

if username== "" or password=="" :
raise ValueError("All field are requred")
print ("Signup susscessful!")
"""
Handles the user login process by verifying the provided username and password.

Expand Down
16 changes: 15 additions & 1 deletion banking_app/signup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
# signup.py - Placeholder for signup functionality

def signup(username, password, email):
"""

if username== "" or password=="" or email== "":
raise ValueError("All field are requred")
print ("Signup susscessful!")

if (len(password) < 8 or
all(char.isdigit() == False for char in password) or
all(char.isupper() == False for char in password) or
all(char.islower() == False for char in password) or
all(char in "!@#$%^&*()_+-=[]{}|;:',.<>?/`~" == False for char in password)):
raise ValueError("Password does not meet minimum requirements")



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

Instructions for Implementation:
Expand Down
3 changes: 2 additions & 1 deletion banking_app/user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def read_users():
"""Reads all users from the CSV database and returns a list of dictionaries."""
users = []
try:

with open(DATABASE_FILE, mode='r') as file:
reader = csv.DictReader(file)
for row in reader:
Expand Down Expand Up @@ -36,4 +37,4 @@ def write_users(users):
"balance": f"{user['balance']:.2f}",
})
except Exception as e:
raise RuntimeError(f"Failed to write to database: {str(e)}") # except this error in your code
raise RuntimeError(f"Failed to write to database: {str(e)}") # except this error in your code
35 changes: 24 additions & 11 deletions functions_to_test.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
# 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
return max(a,b,c)



def is_palindrome(string):
pass
string = string.replace(" ","")
reversed_word = string[::-1]
return string.lower() == reversed_word.lower()

def count_word_occurrences(text, word):
pass
text.lower().count(word.lower())

def read_file_lines(filepath):
pass
with open('filepath', 'r') as file:
file = file.readlines()
for line in file:
print(line.strip())


def factorial(n):
pass
if n == 0:
return 1
else:
return n* factorial(n-1)

def is_prime(n):
pass

def is_prime(n):
pass

def sort_numbers(numbers):
pass
return sorted(numbers)

def factorial(n):
pass

def fibonacci(n):
pass



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

"""
Solve the Tower of Hanoi problem for n disks.
Expand Down