-1

how to take an algebraic expression as an input from the user? e.g x^2 + sin(x) e.g. sin(x) +cos(x) something like that and solve for some value of x In Java, we use buffered reader and expression input functions, but in python3.x what I have to use?

1 Answers1

0

You can use the input() function in Python 3.

x = input()
print(x + " World")

>>> Hello
Hello World


x = input("Type a number: ")
print(int(x) * 2)

>>> Type a number: 5
10
theberzi
  • 1,439
  • 2
  • 17
  • 24