A Quickstart Guide for writing code in Python.
"Python is an experiment in how much freedom programmers need. Too much freedom and nobody can read another's code; too little and expressiveness is endangered." - Guido van Rossum
#!/bin/bash | |
# Set the execute permission for this file: | |
# $ chmod +x arm_run.sh | |
# use: | |
# $ ./arm_run.sh path/to/file //file name without .s extension | |
echo "Assembling and running file: $1.s" |
The return_value
configures the value returned when the mock is called. It will always return the same value when the mock is called.
The side_effect
argument can accept a function to be called when the mock is called, an iterable or an Exception.
By passing in an iterable we can mock multiple inputs inside the testing function,
because it will yield the next value everytime it’s called.
import unittest
git init
git remote add <name> <link>
git add .
git log <remote/branch>
git status
# Collatz conjecture: | |
# https://en.wikipedia.org/wiki/Collatz_conjecture#Iterating_on_all_integers | |
import sys | |
# s,f=sys.stdin.readline().split() | |
# s=int(s) | |
# f=int(f) | |
s = 1 | |
f = 1000000 |
# algorithm to order sequence for optimal binary tree construction | |
import sys | |
def arrange(numArray): | |
if len(numArray) == 0: | |
return numArray | |
numArray.sort() |