- 1
It is showing syntax error plz help
5 odpowiedzi
+ 2
It should be int(input())
Not just input() because input() takes the number you enter as a string whereas int changes it's datatype to integer.
Correct code:
n1=int(input("x"))
n2=int(input('y'))
sum=n1+n2
print("sum of the number=",sum)
prod=n1*n2
print("product of the number=",prod)
+ 1
Unfortunately there are a lot of issues with your code. You should start over with the Python for Beginners course to learn the basics of python.
+ 1
Yes, im beginner thanks
+ 1
Or float(input()) if you want it to work for numbers with decimals.
+ 1
If my guess is correct the code should take two inputs and print the sum and product.
Try this instead:
https://code.sololearn.com/cZV5eJZDf08L/?ref=app