一直想用已有的皮毛知识做24点算数,苦于没思路
终极版是要加入开根号,幂次方,但现在连加减乘除的都还写不出来,先把这点存货记录在这里
# -*- coding: utf-8 -*-
import math
operators = ['+', '-', '*', '/', '√', '^']
for op in operators:
print op
class Calc24():
# 根号
def Rootof(self, value):
print math.power(self.value)
#幂次方
def Powerof(self, value):
print math.sqrt(self.value)
def __init__(self, value):
self.value = value
if __name__ == "__main__":
store = None
input_lmiit = 10
input_max = 4
for i in range(input_max):
print i
store[i] = input("please input: ")
for j in store:
print j