Back to problems

Toy Language Interpreter

Algorithm · OpenAI · Easy

Problem Overview Create a small interpreter that reads and runs instructions from a basic toy language. It must recognize and execute these command forms: Assigning Variables: x = 5 stores an integer in a variable. Adding Values: x = x + 2 performs straightforward integer addition. Printing Values: PRINT x writes a variable's current value to the console. Sample Input Sample Output Constraints Each variable identifier consists of one lowercase letter. Operands are integer…

Checking your access…