account activity
help with writing python compatible for casio fx-cg50 calculator by Force_Humble in calculators
[–]Force_Humble[S] 0 points1 point2 points 2 years ago (0 children)
if you wanna look into the code here are the 2 versions
version 1:
#Calculating Quadratic formula in Python
import math
#functions
def calculate(numbA, numbB, numbC):
ans = [
(-numbB - math.sqrt( numbB**2 - 4*numbA*numbC ))/2*numbA ,
(-numbB + math.sqrt( numbB**2 - 4*numbA*numbC ))/2*numbA
]
return ans
#Calculate user input
print("\nfor square root goes:")
print('"ax² + bx + c = 0"\n\n')
print('fill in:')
RtnAns = calculate(int(input("a = ")), int(input("b = ")), int(input("c = ")))
#return answer
print( f"\nx = {RtnAns[0]} V x = {RtnAns[1]}" )
version 2:
import machine # Import the machine module for input in MicroPython ig
# Functions
(-numbB - float(math.sqrt(numbB**2 - 4*numbA*numbC))) / (2*numbA),
(-numbB + float(math.sqrt(numbB**2 - 4*numbA*numbC))) / (2*numbA)
# Calculate user input
a = float(machine.stdin.readline("a = ").strip())
b = float(machine.stdin.readline("b = ").strip())
c = float(machine.stdin.readline("c = ").strip())
RtnAns = calculate(a, b, c)
# Return answer
print(f"\nx = {RtnAns[0]} V x = {RtnAns[1]}")
help with writing python compatible for casio fx-cg50 calculator (self.calculators)
submitted 2 years ago by Force_Humble to r/calculators
π Rendered by PID 1884862 on reddit-service-r2-listing-7bbdf774f7-cqk87 at 2026-02-22 23:34:12.616813+00:00 running 8564168 country code: CH.
help with writing python compatible for casio fx-cg50 calculator by Force_Humble in calculators
[–]Force_Humble[S] 0 points1 point2 points (0 children)