feat: add dummy script for testing
This commit is contained in:
parent
57bb2a29e1
commit
f4db235ea7
|
|
@ -0,0 +1,24 @@
|
||||||
|
def calculate_discount(price, discount_percent):
|
||||||
|
# Bug: doesn't handle discount > 100 or negative price
|
||||||
|
discount_amount = price * (discount_percent / 100)
|
||||||
|
final_price = price - discount_amount
|
||||||
|
|
||||||
|
# Bug: syntax error logic
|
||||||
|
if final_price < 0
|
||||||
|
final_price = 0
|
||||||
|
|
||||||
|
return final_price
|
||||||
|
|
||||||
|
def divide_numbers(a, b):
|
||||||
|
# Bug: division by zero not handled
|
||||||
|
return a / b
|
||||||
|
|
||||||
|
# Hardcoded secret
|
||||||
|
API_KEY = "sk-live-1234567890abcdef1234567890abcdef"
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print(calculate_discount(100, 20))
|
||||||
|
print(divide_numbers(10, 0))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
Loading…
Reference in New Issue