{}
Build with AI. Win prizes. Get featured on the Wall.
Join Challenge
Build with AI. Win prizes. Get featured on the Wall. Join Challenge
run-icon
main.py
#op calc v2 current wip import math def gcd(a,b): return(a/math.gcd(a,b),b/math.gcd(a,b),math.gcd(a,b)) import random print("1.add") print("2.subtract") print("3.multiply") print("4.divide") print("5.square root") print("6.factorialize") print("7.logarithm") print("8.greatst common factor") print("9.multipul roots") ch = input("which do you need ") if ch in ['1','2','3','4']: num1 = float(input("number 1 ")) num2 = float(input("number 2 ")) if ch == '1': print(num1+num2) elif ch == '2': print(num1-num2) elif ch == '3': print(num1*num2) elif ch == '4': print(num1/num2) elif ch == '5': sqq = float(input("what do you need to get the root of ")) print(math.sqrt(sqq)) elif ch == '6': fcq = int(input("what do you need to factor ")) print(math.factorial(fcq)) elif ch == '7': lgb = float(input("whats the base ")) lgn = float(input("whats the number ")) print(math.log(lgn, lgb)) elif ch == '8': gcf1 = int(input("whats the first factor ")) gcf2 = int(input("what the second factor ")) print(gcd(gcf1,gcf2)) elif ch == '9': r = int(input("how any do you need ")) mr = [] for _ in range(r): ip = int(input("what number ")) mr.append(math.sqrt(ip)) print(mr)
Output