You need to indent your code properly:
import os
for x in os.listdir("/home/"):
print x
3
solved Python list contents error [duplicate]
You need to indent your code properly:
import os
for x in os.listdir("/home/"):
print x
3
solved Python list contents error [duplicate]