Published

Code Blocks Example

Authors

A sample post with markdown.

Inline Highlighting

Sample of inline highlighting sum = parseInt(num1) + parseInt(num2)

Code Blocks

Some Javascript code


_5
var num1, num2, sum;
_5
num1 = prompt("Enter first number");
_5
num2 = prompt("Enter second number");
_5
sum = parseInt(num1) + parseInt(num2); // "+" means "add"
_5
alert("Sum = " + sum); // "+" means combine into a string

Some Python code 🐍


_8
def fib():
_8
a, b = 0, 1
_8
while True: # First iteration:
_8
yield a # yield 0 to start with and then
_8
a, b = b, a + b # a will now be 1, and b will also be 1, (0 + 1)
_8
_8
for index, fibonacci_number in zip(range(10), fib()):
_8
print('{i:3}: {f:3}'.format(i=index, f=fibonacci_number))