Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104138 > unrolled thread

Phyton

Started by"Diego ..." <diegopinder@hotmail.com>
First post2016-03-05 15:41 +0000
Last post2016-03-06 19:30 +0000
Articles 11 — 8 participants

Back to article view | Back to comp.lang.python


Contents

  Phyton "Diego ..." <diegopinder@hotmail.com> - 2016-03-05 15:41 +0000
    Re: Phyton marco.nawijn@colosso.nl - 2016-03-06 07:28 -0800
      Re: Phyton BartC <bc@freeuk.com> - 2016-03-06 15:33 +0000
      Re: Phyton Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-06 17:05 +0000
        Re: Phyton Steven D'Aprano <steve@pearwood.info> - 2016-03-07 10:14 +1100
          Re: Phyton Larry Martell <larry.martell@gmail.com> - 2016-03-06 18:19 -0500
          Re: Phyton Chris Angelico <rosuav@gmail.com> - 2016-03-07 10:28 +1100
        Re: Phyton marco.nawijn@colosso.nl - 2016-03-06 22:45 -0800
          Re: Phyton Chris Angelico <rosuav@gmail.com> - 2016-03-07 18:57 +1100
      Re: Phyton Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-06 10:20 -0700
      Re: Phyton Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-06 19:30 +0000

#104138 — Phyton

From"Diego ..." <diegopinder@hotmail.com>
Date2016-03-05 15:41 +0000
SubjectPhyton
Message-ID<mailman.245.1457273767.20602.python-list@python.org>
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 ????

[toc] | [next] | [standalone]


#104149

Frommarco.nawijn@colosso.nl
Date2016-03-06 07:28 -0800
Message-ID<ab5e40ce-e6d7-4c0a-8531-314fd7a695ff@googlegroups.com>
In reply to#104138
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

Marco

[toc] | [prev] | [next] | [standalone]


#104150

FromBartC <bc@freeuk.com>
Date2016-03-06 15:33 +0000
Message-ID<nbhif7$174$1@dont-email.me>
In reply to#104149
On 06/03/2016 15:28, marco.nawijn@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


[toc] | [prev] | [next] | [standalone]


#104158

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2016-03-06 17:05 +0000
Message-ID<mailman.256.1457284208.20602.python-list@python.org>
In reply to#104149
On 06/03/2016 15:28, marco.nawijn@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
>
> Marco
>

Why in the year 2016 are people still giving links to the Luddite Python 
2 docs?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#104176

FromSteven D'Aprano <steve@pearwood.info>
Date2016-03-07 10:14 +1100
Message-ID<56dcb9bf$0$1599$c3e8da3$5496439d@news.astraweb.com>
In reply to#104158
On Mon, 7 Mar 2016 04:05 am, Mark Lawrence wrote:

> Why in the year 2016 are people still giving links to the Luddite Python
> 2 docs?

Because Python 2.7 is still supported, and will be officially supported
until 2020, after which it will still have third-party support from
companies like Red Hat until at least 2023.

And I take exception to your use of the word "Luddite" to describe Python 2.
Python 2 is a perfectly fine programming language, and it will continue to
be used by some well past 2020. There's no need to bully people into
upgrading to Python 3, or insult those using Python 2. Python 2 is here for
the long haul.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#104177

FromLarry Martell <larry.martell@gmail.com>
Date2016-03-06 18:19 -0500
Message-ID<mailman.2.1457306389.10335.python-list@python.org>
In reply to#104176
On Sun, Mar 6, 2016 at 6:14 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> On Mon, 7 Mar 2016 04:05 am, Mark Lawrence wrote:
>
>> Why in the year 2016 are people still giving links to the Luddite Python
>> 2 docs?
>
> Because Python 2.7 is still supported, and will be officially supported
> until 2020, after which it will still have third-party support from
> companies like Red Hat until at least 2023.
>
> And I take exception to your use of the word "Luddite" to describe Python 2.
> Python 2 is a perfectly fine programming language, and it will continue to
> be used by some well past 2020. There's no need to bully people into
> upgrading to Python 3, or insult those using Python 2. Python 2 is here for
> the long haul.

I am an independent contractor and I have worked for 7 companies in
the last 10 years. A total of 1 of those 7 are using python 3. All the
others are using 2.

[toc] | [prev] | [next] | [standalone]


#104178

FromChris Angelico <rosuav@gmail.com>
Date2016-03-07 10:28 +1100
Message-ID<mailman.3.1457306928.10335.python-list@python.org>
In reply to#104176
On Mon, Mar 7, 2016 at 10:14 AM, Steven D'Aprano <steve@pearwood.info> wrote:
> And I take exception to your use of the word "Luddite" to describe Python 2.
> Python 2 is a perfectly fine programming language, and it will continue to
> be used by some well past 2020. There's no need to bully people into
> upgrading to Python 3, or insult those using Python 2. Python 2 is here for
> the long haul.

I would, however, use the term "legacy" to describe Python 2. It's no
longer the "current stable" version - it's the "old stable", being
maintained at its current state and not advanced further. It's not as
insulting as "Luddite", and more accurate.

ChrisA

[toc] | [prev] | [next] | [standalone]


#104190

Frommarco.nawijn@colosso.nl
Date2016-03-06 22:45 -0800
Message-ID<541c9626-42ce-42fb-b7a1-a773650b9177@googlegroups.com>
In reply to#104158
On Sunday, March 6, 2016 at 6:10:22 PM UTC+1, Mark Lawrence wrote:
> On 06/03/2016 15:28, marco.nawijn@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
> >
> > Marco
> >
> 
> Why in the year 2016 are people still giving links to the Luddite Python 
> 2 docs?
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence



On Sunday, March 6, 2016 at 6:10:22 PM UTC+1, Mark Lawrence wrote:
> On 06/03/2016 15:28, marco.nawijn@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
> >
> > Marco
> >
> 
> Why in the year 2016 are people still giving links to the Luddite Python 
> 2 docs?
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence


> Why in the year 2016 are people still giving links to the Luddite Python 
>2 docs?

As Ian already mentioned, the Python 2 docs came up as the first hit on
Google. However, I agree with you that for a newcomers to Python a link
to Python 3 would probably have been more appropriate (not that I believe
the content of the sections would be any different). 

As a side note, you are probably aware that if you look at the Linux
ecosystems there are still a lot of distributions that have Python 2
as a default. There are still also large mainstream libraries that
do not (or just very recently) have support for Python 3. For me this
in particular applied to VTK. I am now finally ready to move to Python 3.

Marco

[toc] | [prev] | [next] | [standalone]


#104192

FromChris Angelico <rosuav@gmail.com>
Date2016-03-07 18:57 +1100
Message-ID<mailman.9.1457337475.10335.python-list@python.org>
In reply to#104190
On Mon, Mar 7, 2016 at 5:45 PM,  <marco.nawijn@colosso.nl> wrote:
> As a side note, you are probably aware that if you look at the Linux
> ecosystems there are still a lot of distributions that have Python 2
> as a default. There are still also large mainstream libraries that
> do not (or just very recently) have support for Python 3. For me this
> in particular applied to VTK. I am now finally ready to move to Python 3.

There aren't many mainstream libraries that are still being developed
and don't support Python 3 and don't have equivalents that support
Python 3. There are a reasonable number of third-party modules that
are basically "hey folks, here's the bindings for C++, here's the
bindings for Java, and here's the bindings for Python", where "Python"
has for years meant Py2 only; from what I see of VTK, that seems to be
the case. (It's true of the Google API module, too.) The only way to
get this sort of thing to change is to show these companies that there
is real demand for Python 3 support.

As to Linux distros having Py2 as default - there are two separate
things here. One is that the name "python" will run Python 2, and
Python 3 has to be invoked as "python3". That's stipulated by PEP 394,
and won't be changing. The second concept is of packages being
installed by default, and/or being depended on by critical services.
At the moment, that's more Py2 than Py3, but several distros are
working on migrating (Ubuntu tried hard to have 14.04 ship without Py2
on the main CD ISO, but failed; not sure where they're at now, but
it's definitely the plan), and that's going to start shifting. But for
an application developer, it hardly even matters. If you ship Ruby
code, you declare a dependency on Ruby; if you ship Python code, you
declare a dependency on either Python 2 or Python 3, or "python-any"
or somesuch if you're compatible with both. It's easy enough to have
both Pythons installed on every Linux system that I've ever worked on,
and I rather doubt that that will change.

ChrisA

[toc] | [prev] | [next] | [standalone]


#104160

FromIan Kelly <ian.g.kelly@gmail.com>
Date2016-03-06 10:20 -0700
Message-ID<mailman.258.1457284879.20602.python-list@python.org>
In reply to#104149
On Sun, Mar 6, 2016 at 10:05 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> Why in the year 2016 are people still giving links to the Luddite Python 2
> docs?

Maybe because it's the version that comes up when googling for "python
if statement".

[toc] | [prev] | [next] | [standalone]


#104169

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2016-03-06 19:30 +0000
Message-ID<mailman.267.1457292692.20602.python-list@python.org>
In reply to#104149
On 06/03/2016 17:20, Ian Kelly wrote:
> On Sun, Mar 6, 2016 at 10:05 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
>> Why in the year 2016 are people still giving links to the Luddite Python 2
>> docs?
>
> Maybe because it's the version that comes up when googling for "python
> if statement".
>

The obvious solution is to take down all the Python 2 stuff so people 
can only find Python 3, problem solved.

Hears screams of anguish despite having ears firmly closed :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web