[Tutor] Help on Python
David Lowry-Duda
david at lowryduda.com
Tue Oct 15 11:44:52 EDT 2019
Hello Tyson,
You have found the right email and come to the right place.
> I am new to Python and had a question.
>
> incomevar = (input("Please enter the income: ")
> income = int(incomevar)
> costvar = int(input("Please enter the cost: ")
> cost = int(costvar)
> if income >= cost :
> print (income - cost == profit)
> else income < cost :
> print (cost - income == loss)
>
> I have tried many things for this to work, including changing the variable
> names, spacing issues. Nothing seems to work and I am quite confused. I
> honestly don't even know if this is the right email address to send
> this to.
To get a good response, I suggest you give a bit of additional info. In
particular, I suggest that you add
- what you are trying to do
- what you expect your program to run and do
- the output of your program when it runs (or the error if an error is
produced)
This advice applies not only to this post, but any future questions you
might give to any programming-help environment.
With your post --- with proper indentation, I expect that your program
would not run because `profit` and `loss` are not defined.
Good luck!
- DLD
--
David Lowry-Duda <david at lowryduda.com> <davidlowryduda.com>
More information about the Tutor
mailing list