Basic Calculator only in one line,
-
while: Initiates a loop that continues execution as long as the specified condition holds (
while 1
creates an infinite loop). -
input: Prompts the user to provide input, in this case, a basic mathematical operation.
-
eval: Dynamically evaluates the entered mathematical expression, treating it as a Python expression.
-
print: Outputs the result of the evaluated expression to the console.
-
1: The condition for the
while
loop, ensuring it runs indefinitely.