d3dname commited on
Commit
8962ee2
·
verified ·
1 Parent(s): 8ee9804

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -42,6 +42,8 @@ def calculator(input_text):
42
  return f"Error: {str(e)}"
43
 
44
  def append_to_input(current, value):
 
 
45
  if value in ['+', '-', '*', '/']:
46
  return current + f" {value} "
47
  return current + value
@@ -50,6 +52,8 @@ def clear_input(current):
50
  return ""
51
 
52
  def backspace(current):
 
 
53
  return current[:-1]
54
 
55
  class CalculationInput(BaseModel):
 
42
  return f"Error: {str(e)}"
43
 
44
  def append_to_input(current, value):
45
+ if current is None:
46
+ current = ""
47
  if value in ['+', '-', '*', '/']:
48
  return current + f" {value} "
49
  return current + value
 
52
  return ""
53
 
54
  def backspace(current):
55
+ if current is None:
56
+ return ""
57
  return current[:-1]
58
 
59
  class CalculationInput(BaseModel):