+ 1
Can some1 help with this simple operation
print("test") print ("enter the amount now") X = input ( ) print (X) print("enter usage now") Y = input ( ) print (Y) print int (X) +(Y) print("the calculated value is:")
7 odpowiedzi
+ 4
Right...
You are using 3.x ( I try with 2.7 )... you must set parenthesis to your print statement, and you was right for int() function ^^
print(int(X)+int(Y))
+ 3
print int(X)+int(Y) # you forgot the 2nd 'int'...
+ 2
I make a mistake ^^
print X+Y # no int() function in Python...
If Python 3.x:
print(X+Y)
In code playground this is Python 3.x, and the user inputs may to be all done just before starting script...
+ 1
ok I used 2 figures 24 and 12 should add to 36 but code is coming out as 2412
0
ok will try this
0
thank you that worked
0
make sure the variables aren't capital letters too