[Tutor] Python Calculator Help needed ASAP!!
Alan Gauld
alan.gauld at btinternet.com
Mon Sep 30 20:30:37 EDT 2019
On 01/10/2019 00:12, Raj Patel wrote:
> Hi so Im a university student new to python, and I’ve been given a mini assignment to create a calculate on python, on of the function it must have is that once the user has already calculated something and wants to recalculate something with that result the second time the input calls the result becomes one of the two nums
>
> Ex. Choose an operator: +
> Enter the first number: 56
> Enter the second number: 8
> Result: 64
>
> Choose an operator:+
> Enter the first number: (since I’d be leaving this blank the result from the last equation would become the number here)
> Enter the second number: 10
> Result: 74
Thanks for the clear explantion of your assignment.
Now what do you want us to help you with?
What have you done so far?
Do you know how to prompt for and read a string from the user?
Do you know how o convert an input string to a number?
Do you know how to add two numbers and store the result?
Do you know how to detect an empty string?
If you know all of the above you know how to solve the problem.
If not tell us what part you don't know.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list