11 Ways to Make Python a Dangerous Language For Data Science

More from: | HackerNoon |

1.Whitespace Formatting

Many language use curly braces to delimit blocks of code.Python uses indentation:

for i in [1,2,3,4,5]:
print (i)
for j in [1,2,3,4,5]:
print (j)
print (i + j)
print (i)
print (“Done looping”)

This makes Python code very readable,but it also means that you have to be very careful with your formatting.Whitespace is ignored inside parentheses and brackets,which can be helpful for long-winded computations:

long_winded_computation =(1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20)

and for making code easier to read:

list_of_lists = [[1,2,3], [4,5,6], [7,8,9]]


Read full article » https://hackernoon.com/11-ways-to-make-python-a-dangerous-language-for-data-science-cc51e0dea1a4?source=rss----3a8144eabfe3---4

About | HackerNoon |

...how hackers start their afternoons....

»Twitter: @hackernoon »Facebook: @hackernoon