Skip to content
Advertisement

Tag: calculator

If statement not executing. Python

I am still new to programming and I wanted to do a simple calculator in python. However, I could only reach this point of my code: Not sure why my if statement is not executing after all the correct inputs from the user. I mostly focused on the error handling part and after everything going well, the if statement is

Calculator not functioning properly

Hey I’m trying to make a small calculator for a project, however I’m struggling to get the code to work. When I try to run operation 4, I want the code to ask if you would like to run another calculation, if you answer with ‘yes’ it will repeat the statement again. However all it does is stop the code.

How to make a calculator function that uses the operator as an input?

I started learning Python yesterday; this is the first calculator I’ve made. I noticed that the last lines of code that print the equation’s result are repeated. Can I write a function that takes the operator as input and then prints the result with just one line of code? I imagine it would be something like this: def result(operator): print((str(num1))

I need help understanding the problem here

I’m trying to make an age calculator that is accurate enough to calculate age based on whether the person has had their birth day this year or not. The problem is something is wrong with my code so even thought when I input “No” it should deduct -1 from the age result but it doesn’t do this. This is the

How can I run Python on my HP Prime graphing calculator?

According to this firmware post, the HP Prime graphing calculator supports Python. However, I cannot find any guide as to how to run python files in the calculator (even within HP’s own 700 page long user manual). Does anyone know how to execute these files? For reference, I have HP Prime’s connectivity kit (CK) installed, so I am somewhat able

Advertisement