repl.it
@HristoGueorguie/

Whats more readable ...

Python

What statement would you prefer to encounter in a code base ?

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Lets play a game of what is more readable 

z = [[1,2],[3,4],[5,6]]

# Hummm wait is this perl ?!
print([x for y in z     for x in y])
#        ^#########     ^###########
#        left most      Going to the
#        = outer most   right goes a
#        list/array     level deeper

# Verbose yes I know
a = []
for y in z: 
  for x in y:
    a.append(x)
print(a)
Fetching token
?