def square(x):
return x**2
for i in range(10):
print(square(i))0
1
4
9
16
25
36
49
64
81
July 21, 2017
The goal is to see how well this feature works. I’d like to be able to post Python code to my blog. Happily, Nikola supports that seamlessly.
Normally Nikola preserves the width of each notebook cell. It makes sense that it does this but that doesn’t work so well with this template because of the navigation bar on the left side of the screen. That’s OK, I can override it by changing the notebook styling with this if I need to:
#notebook-container {
width: 800px;
}
And here is some Python code:
And a plot:
Magnificent!