Jump to content
Wikibooks The Free Textbook Project

Talk:Python Programming/Overview

Page contents not supported in other languages.
Add topic
From Wikibooks, open books for an open world

When I type in the source code given in this page:

>>> a,b = 0,1
>>> while b < 100:
... a,b = b,(a+b)
... print(a, end=" ")
... 
1 1 2 3 5 8 13 21 34 55 89 144

I get an error: SyntaxError: invalid syntax The equality sign (right after "end") is marked red.

I'm not in expert in Python so I'm not sure there is a mistake in the code but for me it seems so.

Nikolay Komarov (discusscontribs) 14:53, 17 February 2011 (UTC) Reply

For beginners, Fibonacci not the best choice

[edit source ]
Latest comment: 13 years ago 1 comment1 person in discussion

This is an introduction page.

If the target audience for this page is a user already familiar with mathematics and programming, a Fibonacci-series example can make sense. If however, the target reader is new to programming or not that savvy mathematically, Fibonacci is not a good choice. May I suggest the example code be replaced with something newcomers to Python are more likely to relate to?

Further, while "a,b = 0,1" is a valid Python construct it confuses readers new to Python, especially without explanation. Python is a very powerful language but it would be better to use more conventional constructs lest the newcomer see Python as too complex and not worth the time to delve deeper.

--Larry

67.168.50.231 (discuss) 23:49, 13 September 2011 (UTC) Reply

AltStyle によって変換されたページ (->オリジナル) /