Beginner needs advice

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri May 27 11:52:14 EDT 2011


On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote:

> 3.x is completely incompatible with 2.x (some call it a dialect, 
> but that is a lie).

"Completely incompatible"? A "lie"?


import math
import random
my_list = [3, 5, 7, 9]
n = random.choice(my_list)
if n%3:
    func = math.sin
else:
    func = math.cos

y = func(math.pi/n)*10
L = ['spam']*(int(y))
for item in L:
    print(item)


is valid syntax in every version of Python from 1.5 to 3.2, and it does 
the same thing in all of them. Would you care to revise your claims?



-- 
Steven



More information about the Python-list mailing list