Monday, December 9, 2019

Tuple comprehension not support in python

a=(x*x for x in range(1,11))
#print(a)
for x in a:
    print(x)

output:
1
4
9
16
25
36
49
64
81
100

No comments:

Post a Comment

python class topic video