"Christopher Spears" <[EMAIL PROTECTED]> wrote
>I wrote a simple calculator script:
>
> #!/usr/bin/python env
>
> def calculator(n1, operator, n2):
>f1 = float(n1)
>f2 = float(n2)
You probably shouldn't do this since it forces all
your results to be floats even if the two arguments
a
I wrote a simple calculator script:
#!/usr/bin/python env
def calculator(n1, operator, n2):
f1 = float(n1)
f2 = float(n2)
if operator == '+':
return f1 + f2
elif operator == '-':
return f1 - f2
elif operator == '*':
return f1 * f2
elif operator == '