On Sun, Aug 6, 2017 at 11:35 PM, boB Stepp wrote:
>
> I see no difference in result, whether I use the @staticmethod decorator or
> not.
While a staticmethod and a function are both descriptors [1], a
staticmethod is basically a no-op descriptor. Its __get__ method
always returns its unbound cal
On 07/08/17 00:35, boB Stepp wrote:
> =
> Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64
> bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> p
On Aug 6, 2017 11:00 AM, 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...@pyth
I am looking more deeply into the subject of decorators for a bit (So
I can thoroughly digest Steve's information in the thread "basic
decorator question".) and have been first looking at static and class
methods. As a start, I have tried the following:
===
Curses! I screwed up my later insertion. I should have written in my footnote:
On Sun, Aug 6, 2017 at 3:20 PM, boB Stepp wrote:
> [1] An exception is "Beginning Python -- From Novice to Professional,
> 3rd ed." by Magnus Lie Hetland, c. 2017. I recently acquired this
> book and so far I am e
On Sun, Aug 6, 2017 at 1:23 PM, Mats Wichmann wrote:
> Meanwhile, it is worth pointing out that while: (as with other python
> loops) can take an else: clause, which is executed if the loop runs to
> completion and was not exited via break. That means you could ALSO
> write (this is pseudo-code
On 08/06/2017 11:35 AM, boB Stepp wrote:
> So these final two "if" groupings should be _outside_ your while loop:
>
> while guessesTaken < 6:
>
>
> if guess_value == number:
> print('good job, ' + myName + '! you guessed my number in',
> guessesTaken, 'guesses!')
>
> else:
> print(
On Sat, Aug 5, 2017 at 1:28 PM, Howard Lawrence <1019sh...@gmail.com> wrote:
> # this is a guess number game.
> import random
>
> guessesTaken = 0
>
> print('hello! What is your name?')
> myName = input()
>
> number = random.randint(1, 20)
> print('Well, ' + myName + ', i am thinking of a number be
On 06Aug2017 07:19, Alan Gauld wrote:
On 05/08/17 19:28, Howard Lawrence wrote:
if guess_value != number:
number = str(number)
print ('nope. the number i was thinking of was ' + number)
There is the problem, you convert number to a str before printing
it. so next iteration