bumsfeld 413 Nearly a Posting Virtuoso

More examples:

# a multiconditional statement
if x > 0:
  if x < 10:
    print("x is larger than zero and less than 10")

# a simpler version
if 0 < x < 10:
  print("x is larger than zero and less than 10")

# is character lower case?
if 'a' <= character <= 'z':
  print(character)
bumsfeld 413 Nearly a Posting Virtuoso

Use list slicing and extend().
Hint:

mylist = [0,1,2,3,4,5,6,7,8,9]
ix = 3

t1 = mylist[0:ix]
t2 = mylist[ix+1:]

# now use list extend()
t2.extend(t1)

print(t2)  # [4, 5, 6, 7, 8, 9, 0, 1, 2]
bumsfeld 413 Nearly a Posting Virtuoso

Python has all the tools to do such a thing.

bumsfeld 413 Nearly a Posting Virtuoso

Use slice and extend(), for example:

mylist1 = [1,2,3]
mylist2 = ['a','b','c']

# slice mylist into two temporary lists at index 2
t1 = mylist1[0:2]
t2 = mylist1[2:]

# now use list extend()
t1.extend(mylist2)
t1.extend(t2)

print(t1)  # [1, 2, 'a', 'b', 'c', 3]
bumsfeld 413 Nearly a Posting Virtuoso

Split your large project into a series of small projects.

bumsfeld 413 Nearly a Posting Virtuoso

Get yourself a Raspberry Pi and start a project.

Check out:
http://www.raspberrypi.org/
http://www.instructables.com/id/Raspberry-Pi-Projects/

bumsfeld 413 Nearly a Posting Virtuoso

gesundheit

bumsfeld 413 Nearly a Posting Virtuoso

One computer is just not enough. I usually have my desktop PC, two netbooks and an IPad going.

bumsfeld 413 Nearly a Posting Virtuoso

"He was a wise man who invented beer."
~~~ Plato

bumsfeld 413 Nearly a Posting Virtuoso

It's Oktoberfest time, the time for a good bratwurst, grilled chicken, radish, potato salad, all washed down with a stein full of beer.

bumsfeld 413 Nearly a Posting Virtuoso

"A fool with a tool is still a fool."
~~ Roland Hirsch

bumsfeld 413 Nearly a Posting Virtuoso

The IPython Notebook seems to be made for scientific presentations and reports.
To show off things like numpy, matplotlib.pyplot, pylab, seaborn and guiqwt.pyplot. You can tweak your code and see the result in real time.

bumsfeld 413 Nearly a Posting Virtuoso

The strontium clock developed in the US would only have lost only about one second since the earth began. It is accurate to a second in five billion years.

bumsfeld 413 Nearly a Posting Virtuoso

Caesium was discovered in 1860 by German scientists Robert Bunsen and Gustav Kirchhoff. It's a silvery metal with a golden cast that melts at 28.4C (just above room temperature).

It is used in the Caesium Clock at the National Physical Laboratory in the London suburb of Teddington. The clock is accurate to one second in 1.4 million years.

Source:
http://www.bbc.com/news/magazine-29476893

bumsfeld 413 Nearly a Posting Virtuoso

I agree with JorgeM, real world examples/projects are important to keep the students interested.

bumsfeld 413 Nearly a Posting Virtuoso

An IDE like PyScripter would redline line 11 because of the missing comma.

You can also streamline your code further with another function to remove some of the repetition:

def main():
    shipweight = float(input('Please enter the weight of the item you wish to ship: '))
    shipping_charges(shipweight)

def shipping_charges_calc(rate, shipweight):
    print("{} pounds will cost you ${:0.2f} per pound.".format(shipweight, rate))
    total= rate * shipweight
    print("Therefore, your total shipping charge would be ${:0.2f}".format(total))

def shipping_charges(shipweight):
    if shipweight <= 2:
        rate=1.10
    elif shipweight <= 6:
        rate=2.20
    elif shipweight <= 10:
        rate=3.70
    # shipweight > 10 pounds
    else:
        rate=3.80
    shipping_charges_calc(rate, shipweight)

main()

Also read up on the function format(), commonly used with Python 2.7 and higher.

Nice coding though.

bumsfeld 413 Nearly a Posting Virtuoso

Variable daniel will have to an instance of class Radiobutton.

check with
print(type(daniel))

bumsfeld 413 Nearly a Posting Virtuoso

“Why not go out on a limb? That's where the fruit is.”
~~ Will Rogers

bumsfeld 413 Nearly a Posting Virtuoso

Closeup shots of people's faces reading off information in a manner they would not normally talk to each other. Those investigative shows are loaded with it.

bumsfeld 413 Nearly a Posting Virtuoso

Windows 8.1 works for me most of the time!
Not sure if Windows 10.1 will be much better.

bumsfeld 413 Nearly a Posting Virtuoso

Fruit bats, a delicacy for some West Africans, are considered to be the Ebola virus's natural host.

Source:
http://www.bbc.com/news/world-us-canada-29462431

bumsfeld 413 Nearly a Posting Virtuoso

I think I get the idea.

bumsfeld 413 Nearly a Posting Virtuoso

Does anybody have a good example of a Functor in Python?

bumsfeld 413 Nearly a Posting Virtuoso
bumsfeld 413 Nearly a Posting Virtuoso

A little Python history:

Python 1.0 - January 1994
Python 1.5 - December 31, 1997
Python 1.6 - September 5, 2000

Python 2.0 - October 16, 2000
Python 2.1 - April 17, 2001
Python 2.2 - December 21, 2001
Python 2.3 - July 29, 2003
Python 2.4 - November 30, 2004
Python 2.5 - September 19, 2006
Python 2.6 - October 1, 2008
Python 2.7 - July 3, 2010

Python 3.0 - December 3, 2008
Python 3.1 - June 27, 2009
Python 3.2 - February 20, 2011
Python 3.3 - September 29, 2012
Python 3.4 - March 16, 2014

bumsfeld 413 Nearly a Posting Virtuoso

Windows 95 was released on August 24, 1995
As far as computing is concerned this is really, really old!
I can't believe that there are many machines left out there.
Maybe in some museum basement.

bumsfeld 413 Nearly a Posting Virtuoso

Honda parts are expensive and in high demand.

bumsfeld 413 Nearly a Posting Virtuoso

If you are not very handsome, things get tough. How about a sports car to impress her with?

bumsfeld 413 Nearly a Posting Virtuoso

Children should be told to be in a sport rather than watch it.
It takes a couch potato to raise a couch spud.

bumsfeld 413 Nearly a Posting Virtuoso

Eggs and mushroom with one piece of honey cake and hot chocolate