Skip to content

Instantly share code, notes, and snippets.

@weisi
Created July 4, 2014 02:23
Show Gist options
  • Save weisi/735fcb903511f52074ef to your computer and use it in GitHub Desktop.
Save weisi/735fcb903511f52074ef to your computer and use it in GitHub Desktop.
Python: Comment Matters
# tab-width: 4
import sys
arr = ["Segment", "Fault"]
space = " "
nl = "\n"
for i in range(5):
for item in arr:
sys.stdout.write(item)
sys.stdout.write(space)
sys.stdout.write(nl)
# tab-width: 8
import sys
arr = ["Segment", "Fault"]
space = " "
nl = "\n"
for i in range(5):
for item in arr:
sys.stdout.write(item)
sys.stdout.write(space)
sys.stdout.write(nl)
[multiple1902@aurora /t/python] python a.py
Segment Fault
Segment Fault
Segment Fault
Segment Fault
Segment Fault
[multiple1902@aurora /t/python] python b.py
Segment
Fault
Segment
Fault
Segment
Fault
Segment
Fault
Segment
Fault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment