-1
私は方程式の計算をしようとしています。xの前に数字があるかどうかを調べるためのチェッカーを持っていますか?それを増やすことができるようにします。 raw_inputに数字があるかどうかを確認するにはどうすればよいですか?方程式計算のためにraw_inputに数字があるかどうか調べる方法
def x_pluse_y(total):
x = raw_input('what is your x? ')
y = raw_input('what is your y? ')
if x == 'x':
x = 0
if y == 'y':
y = 0
float(x) + float(y) == float(total)
step1 = float(total) - float(y)
x = step1
step2 = int(total) - int(x)
y = step2
print 'Your x is ' + str(x)
print 'Your y is ' + str(y)
def x_minus_y(total):
x = raw_input('what is your x? ')
y = raw_input('what is your y? ')
if x == 'x':
x = float(0)
if y == 'y':
y = float(0)
if x > 0:
x == x
elif y > 0:
y == y
if float(x) > 0:
y = float(total) - float(x)
if float(y) > 0 :
x = float(total) - float(y)
print 'Your x is ' + str(x)
print 'Your y is ' + str(y)
def multi_x(equation):
x = raw_input('what is your x? ')
y = raw_input('what is your y? ')
if x == 'x':
x = float(0)
if y == 'y':
y = float(0)
if x > 0:
x == x
elif y > 0:
y == y
if float(x) > 0:
y = float(equation) - float(x)
if float(y) > 0 :
x = float(equation) - float(y)
print 'Your x is ' + str(x)
print 'Your y is ' + str(y)
はplzは、あなたの仕事を表示します。 –
これはあまり残念なことです。 –
raw_input()に数字があるのはどういう意味ですか? 'x = raw_input( 'prompt:')'は、ユーザが入力したテキストが変数xに代入されたことを意味します。 – Holloway