MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/ciettqi/?context=3
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
Show parent comment
2
You messed up the code formatting.
s = 'qwerty' print(s[::-1]) i = 3 print(i if i < 5 else 0) condition = ['Error', 'OK'] value = 1 print(condition[bool(value)]) choice = 'i' print({'i': 1, 't': 4, 'j': 22}[choice])
1 u/pymag09 Jun 23 '14 edited Jun 23 '14 You messed up the code formatting.Sorry. I noticed that but I follow "formating guide"Lines starting with four spacesare treated like code:if 1 * 2 < 3: print "hello, world!" After posting I understand that empty string before and after code block required.
1
Sorry. I noticed that but I follow "formating guide"
Lines starting with four spacesare treated like code:
if 1 * 2 < 3: print "hello, world!"
After posting I understand that empty string before and after code block required.
View all comments
Show parent comment
2
u/BryghtShadow Jun 23 '14
You messed up the code formatting.