Re: [Tutor] (no subject)

2014-05-15 Thread Emile van Sebille

On 5/14/2014 9:57 PM, JEAN MICHEL wrote:


def calcaverage(test1,test2,test3):
 for count in range(test1,test2,test3):
 curraverage=0
 curraverage=((test1[count]+ test2[count]+ test3[count])/3)
 currentaverage.append(curraverage)
 if curraverage>= 90:
 grade= "A"
 lettergrades.append(grade)


Note that once the above if fails such that the below elif is tested, 
you already know that curraverage>= 90 from the if above failed, so

on the elif below you really don't need to test if curraverage < 90.


 elif curraverage >= 80 and curraverage < 90:
 grade= "B"
 lettergrades.append(grade)
 elif curraverage >= 70 and curraverage < 80:
 grade= "C"
 lettergrades.append(grade)
 elif curraverage < 70:
 grade= "F"
 lettergrades.append(grade)


You can also move the lettergrades.append(grade) outside the if tests.

Combining both simplifies this to:

if curraverage>= 90: grade="A"
elif curraverage >= 80: grade = "B"
elif curraverage >= 70: grade = "C"
elif curraverage >= 60: grade = "D"
else: grade = "F"
lettergrades.append(grade)

HTH,

Emile


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 120, Issue 27

2014-05-15 Thread Charles Agriesti, DDS

On 2/6/2014 1:48 AM, tutor-requ...@python.org wrote:

Send Tutor mailing list submissions to
tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
https://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
tutor-requ...@python.org

You can reach the person managing the list at
tutor-ow...@python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."


Today's Topics:

1. Re: Which computer operating system is best for Python (Danny Yoo)
2. Re: Which computer operating system is best for Python (Danny Yoo)
3. Re: Which computer operating system is best for Python
   (Dave Angel)
4. Re: Which computer operating system is best for Python
   (Sacha Rook)


--

Message: 1
Date: Wed, 5 Feb 2014 20:19:55 -0800
From: Danny Yoo 
To: colin.chinsa...@erickson.com
Cc: "tutor@python.org" 
Subject: Re: [Tutor] Which computer operating system is best for
Python
Message-ID:

Content-Type: text/plain; charset=UTF-8

... reading through the rest of this thread... I'm surprised no one
has mentioned:

 http://www.codecademy.com/tracks/python


Depending on your child's level, you might even look at Scratch:

http://scratch.mit.edu/

which is not Python at all, but it is programming, and it is very much
focused on the beginner experience.


--

Message: 2
Date: Wed, 5 Feb 2014 20:42:12 -0800
From: Danny Yoo 
To: Colin Chinsammy 
Cc: "tutor@python.org" 
Subject: Re: [Tutor] Which computer operating system is best for
Python
Message-ID:

Content-Type: text/plain; charset="utf-8"

On Wed, Feb 5, 2014 at 10:34 AM, Colin Chinsammy <
colin.chinsa...@erickson.com> wrote:


  I am considering purchasing the Acer c720 chromebook for my 13yo to
begin learning Python for Kids. Obviously I am on a budget.

Is this a good choice for a complete beginner? Any particular challenges
that she might encounter using a chromebook OS?

Any advice would be greatly appreciated. As I have researched my way into
confusion.



Hi Colin,

Ok, I read this question a little more carefully.

You're planning to use the book "Python for Kids", right?

 http://shop.oreilly.com/product/9781593274078.do

If using that book is a requirement, then I have to take back what I said
about web environments being appropriate for this particular situation.


That book requires a computer running either Windows, Mac OS X, or Linux.
  It will have some exercises that assume that it can have graphical control
over the desktop with the "Tk" graphics library, a capability that you will
not likely have in a web-based environment.

Apologies for not reading the requirements more closely.  I saw "learning
Python for kids", and did not think that you were referring to a specific
book!  :P
-- next part --
An HTML attachment was scrubbed...
URL: 


--

Message: 3
Date: Thu, 6 Feb 2014 00:38:19 -0500 (EST)
From: Dave Angel 
To: tutor@python.org
Subject: Re: [Tutor] Which computer operating system is best for
Python
Message-ID: 

  Steven D'Aprano  Wrote in message:




But still complex. And you're limited by the (lack of) stability of
Windows.

If you don't *need* Windows, there is no point in running Linux on top
of Windows in a virtual machine. It just means you're using twice as
much memory, and you are still bound by the stability of Windows.


Right. I repartitioned my drive,  shrank the installed Windows
  partition to a minimum,  and installed linux as a dual boot. If I
  really need a Windows program,  I run it in a Virtual box with
  XP.

test





___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor