Skip to content
Sign UpLog In
Profile icon

Kavan Belani

@KavanB
  • Group chess

    Cover page
    Made with Python
    Recent comments (0)
Repls
Community
KavanB
KavanB
shared a Post
2 years ago
Calculator
rewrote code and is much better now. Just type in your equation. Works better with no spaces. May glitch on first entry.
Calculator  2.0
Python
KavanB
KavanB
shared a Post
2 years ago
It says invalid syntax on the last line. Can someone tell me why?
Calculator  2.0
Python
FloCal35
FloCal35
Hmm, well you could try deleting line 22 since it has nothing on it2 years ago
KavanB
KavanB
shared a Post
2 years ago
first python project i’ve ever made
AggravatingMammothWebportal
Python
FloCal35
FloCal35
Nice job, one thing to point out. Add a .lower() to the end of your operation variable. Then change the strings in the if statement to "add", "subtract", etc. That way, whether the user says "add","Add",or "ADD", the if statement will still run operation=input("Which operation? (Add, subtract, etc.)").lower() then if operation=="add": ... elif operation=="subtract": ... > [And so on]2 years ago
KavanB
KavanB
shared a Post
2 years ago
My first python project; a basic calculator.
AggravatingMammothWebportal
Python
RhinoRunner
RhinoRunner
str(input()) is not needed, by default input variables will be strings, so you can just do input() instead of str(input()). Also, if you use float instead of int you can use decimals. It is cool that this is more than just a 4-function calculator.2 years ago