Created
March 8, 2011 22:33
-
-
Save evgenidb/861242 to your computer and use it in GitHub Desktop.
fmi.py-bg.net - bad coding 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example 1: | |
# Wrong way: | |
if 1 > 0: print("Hello, World!") | |
# Correct way: | |
if 1 > 0: | |
print("Hello, World!") | |
# Reason - hard to read: | |
#Wrong way: | |
for x in [1, 'foo', ['foo', 'bar', "Hello", "World!", 'Hello, World!'], 2, 3, "aaaa", 4, 5, 6, 11111111111111323121]: print("Hello, World!") | |
#Correct way: | |
for x in [1, 'foo', ['foo', 'bar', "Hello", "World!", 'Hello, World!'], 2, 3, "aaaa", 4, 5, 6, 11111111111111323121]: | |
print("Hello, World!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment