On the command line,
python -c "z = [i for i in range(5)]; print (z)"
gives
[0, 1, 2, 3, 4]
where ;
means there should be a newline.
But what about a newline followed by a tab? Or (gasp) two tabs?
The following code is nonfunctional, but it illustrates what I'd like to be able to do:
python -c "z = [i for i in range(5)]; for i in z: print (i)"
and get as output:
1
2
3
4
5
So basically the question is: How do I execute the following code using python -c
?
z = [i for i in range(5)]
for i in z:
print (i)