Re: [Tutor] class data member and objects of class in python

2013-09-11 Thread Marc Tompkins
On Wed, Sep 11, 2013 at 5:40 AM, zubair alam wrote: > i am learning how a __class__ data member behaves in python as compared to > static data member in java, but following code is throwing error > > > class PizzaShop(): > pizza_stock = 10 > def get_pizza(self): > while not PizzaSh

[Tutor] class data member and objects of class in python

2013-09-11 Thread zubair alam
i am learning how a __class__ data member behaves in python as compared to static data member in java, but following code is throwing error class PizzaShop(): pizza_stock = 10 def get_pizza(self): while not PizzaShop.pizza_stock: PizzaShop.pizza_stock -= 1

Re: [Tutor] Python Programming Help

2013-09-11 Thread Amit Saha
On Wed, Sep 11, 2013 at 7:59 PM, Oscar Benjamin wrote: > On 11 September 2013 10:48, Amit Saha wrote: >> Hi Katie, >> >> So, before you write the solution to the programming problem above, >> can you first try to write a program and then run it? What operating >> system are you working? If you a

Re: [Tutor] [Re:] I need help with the following question

2013-09-11 Thread Steven D'Aprano
On Wed, Sep 11, 2013 at 11:15:26AM +0100, Oscar Benjamin wrote: > There is also the .format method. This was initially intended to > replace % formatting but it was ultimately decided that removing % > formatting was not necessary. Consequently there are now two ways of > doing advanced string for

Re: [Tutor] [Re:] I need help with the following question

2013-09-11 Thread Oscar Benjamin
I'm resending this to the list. Please reply to the tutor list rather than directly to me. Also please don't top-post. My answer is below. On 11 September 2013 10:47, Thabile Rampa wrote: > > On Tue, Sep 10, 2013 at 11:57 AM, Oscar Benjamin > wrote: >> >> On 10 September 2013 08:58, Thabile Ram

Re: [Tutor] Python Programming Help

2013-09-11 Thread Oscar Benjamin
On 11 September 2013 10:48, Amit Saha wrote: > Hi Katie, > > So, before you write the solution to the programming problem above, > can you first try to write a program and then run it? What operating > system are you working? If you are on Windows, can I suggest you to > take a look at these vide

Re: [Tutor] Python Programming Help

2013-09-11 Thread Alan Gauld
On 11/09/13 02:01, Katie wrote: I am a beginner in computer programming. Hi welcome to the tutor list. I am currently trying to write a program in Python version 2.7.5 *that uses the math module to compute sinh(x) = 1/2(e^x - e^(-x)) in three ways for a given value of x:* *1a) by using the si

Re: [Tutor] Python Programming Help

2013-09-11 Thread Amit Saha
Hi Katie, On Wed, Sep 11, 2013 at 11:01 AM, Katie wrote: > Hello, > > I am a beginner in computer programming. I am studying math, and the math > class that I will be taking requires knowledge in Python. So, I am in a > computer science class. Therefore, I do not have an in-depth knowledge of > c

Re: [Tutor] Python Programming Help

2013-09-11 Thread Chris Down
On 2013-09-10 21:01, Katie wrote: > In my NotePad file, I have the following...I'm not sure if I am even going > about doing this problem correctly... I don't envy you having to use notepad. Consider using a more sane editor... you'll thank yourself for it. > def sinh(x): > return (1/2)*(e^x

[Tutor] Python Programming Help

2013-09-11 Thread Katie
Hello, I am a beginner in computer programming. I am studying math, and the math class that I will be taking requires knowledge in Python. So, I am in a computer science class. Therefore, I do not have an in-depth knowledge of computer programming. I am currently trying to write a program