Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: loops

Reply
Thread Tools

Re: loops

 
 
MRAB
Guest
Posts: n/a
 
      12-02-2012
On 2012-12-02 22:28, Verde Denim wrote:
> On 12/02/2012 04:43 PM, Mitya Sirenef wrote:
>> On 12/02/2012 04:39 PM, Verde Denim wrote:
>>> I'm just getting into py coding, and have come across an oddity in a py
>>> book - while loops that don't work as expected...
>>>

[snip]
>>>
>>> This same loop structure appears in many places in this book "Starting
>>> out with Python, 2nd ed, Tony Gaddis), and they all yield the same
>>> error. Is there something I'm missing here?
>>>
>>> Thanks for the input...

>>
>> I believe that should be raw_input, not input . input() evaluates user's
>> input
>> in local scope. -m

>
> m
> Nicely done! That fixed it! Is that a version feature or should I take
> what I find in these books with a grain of salt?
>

It's a difference between Python 2 and Python 3.

Normally a lot of care is taken to maintain backwards compatibility,
but it was decided that the language needed to be tidied up and certain
misfeatures removed.

Python 2 has stopped at version 2.7. Python 3 is currently at version
3.3.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple For Loops? pinod01@sympatico.ca VHDL 1 02-22-2006 03:10 PM
Etherchannel disabled = spanning tree loops... traust Cisco 0 02-21-2006 05:34 PM
Loops with loops using html-template Me Perl Misc 2 01-12-2006 05:07 PM
Perl loops should use break, not last Jeremy Morton Perl 1 01-30-2005 10:50 PM
to many FOR loops? eismaus4 VHDL 1 04-27-2004 02:54 PM



Advertisments