我不知道怎么了。当我在左侧输入 x*x 并在右侧输入 25 时,它不起作用。python shell没有显示错误,但是在我输入解决方案的数量后,什么也没有发生。我认为它可能处于无限循环中,或者每次运行后都没有应用 x 。请帮忙!这是我的代码:
#getting input information
print
print "This program cannot solve for irrational or repeating numbers. Please round for them in your equation."
print
print "Make the variable in your equation stand for x"
print
startingLimit=int(raw_input("What is the lowest estimate that your variable could possibly be?"))
print
wholeNumber=raw_input("Do you know if your variable will be a whole number or a fraction? Answer: yes/no")
if (wholeNumber== "yes"):
print
fraction= raw_input("Is it a decimal/fraction? Answer:yes/no")
if (fraction=="yes"):
print
print "This program will only calculate up to the fourth place to the right of the decimal"
xfinder=0.0001
else:
xfinder=1
else:
xfinder=0.0001
x=0
leftEquation=raw_input("Enter your left side of the equation:")
print
rightEquation=raw_input("Enter the right side of the equation:")
print
amountSolutions=raw_input("How many solutions are there to your equation? (up to 20)")
#solving
indivisualCount=0
count=0
x=startingLimit
while (count!=amountSolutions):
while (count==0):
ifstuffleft=eval(leftEquation)
ifstuffright=eval (rightEquation)
if (ifstuffleft!=ifstuffright):
x=x+xfinder
else:
a=x
count=count+1