Python Forum
Writing an Adder in python 3? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Writing an Adder in python 3? (/thread-22404.html)



Writing an Adder in python 3? - edwdas - Nov-11-2019

So i need to white an Adder REPL.

Instructions are as follows:

quit: Exit the REPL or terminate a program.
input var: Prompt for and allow the user to enter a value for the variable named var
print val: Print the value val
var gets val: variable var is assigned the value val
var adds val: variable var has the value val added to it.

Can someone point me in the right direction? As I'm absolutely clueless at where to start.


RE: Writing an Adder in python 3? - Aurthor_King_of_the_Brittons - Nov-11-2019

I'd start by writing the program out line by line in plain English (pseudocode). Once you've done that, start writing code that corresponds to each line. Google should help with just about every line of code. If you hit a roadblock, post your code here for input.

Ex: If you Google "python code to exit program", the first result shows you how to do it programmatically in Python.