- 1
6 Answers
+ 2
Post your code ^^
+ 2
> x = input(enter first number)
print(x)
y = input(enter second number)
print (y)
print (float(x) + float(y))
The arguments inside the input function should be in quotes.
input("enter a number")
0
i am trying to do exact thing what you wrote as example, though i am asking number rather than giving it in program.
like
>> x = input(enter first number)
print(x)
y = input(enter second number)
print (y)
print (float(x) + float(y))
this is nt working .
0
it shows error in last line
print(float(x)+float(y))
even after the correction you suggested
0
> x = input(enter first number)
print(x)
y = input(enter second number)
print (y)
print (float(x) + float(y))
If that's how your code still look...
Change it to:
x = input("enter first number")
print(x)
y = input("enter second number")
print (y)
print (float(x) + float(y))
The snippet you posted wasn't lined up and the redundant ">".
0
x=float(input("enter a number: "))
print(x)
y=float(input("enter another number: "))
print(y)
print(x+y)