Phyton

BartC bc at freeuk.com
Sun Mar 6 10:33:51 EST 2016


On 06/03/2016 15:28, marco.nawijn at colosso.nl wrote:
> On Sunday, March 6, 2016 at 3:16:19 PM UTC+1, Diego ... wrote:
>> Hello! I have a question in an exercise that says : Write an expression to determine whether a person should or should not pay tax . Consider paying tax people whose salary is greater than R $ 1,200.00
>>
>> I do not know how to mount the logical expression !!!
>>
>> It's like:
>>
>> salary = 1250
>> tax = Not True
>> salary > 1200 or not tax ????
>
> Hello Diego,
>
> You are looking for the "if" statement. See the link below for
> the corresponding documentation:
>     https://docs.python.org/2/tutorial/controlflow.html
>
> Your example would become something like:
>
> salary = 1250.
> if salary > 1200:
>      has_to_pay_tax = True
> else:
>      has_to_pay_tax = False

The OP mentioned finding an expression. So perhaps:


     has_to_pay_tax = salary > 1200

-- 
Bartc






More information about the Python-list mailing list