1940 |
2022 |
Computational thinking is breaking down a problem and formulating a solution in a way that both human and computer can understand and execute.
Source: Wing (2006)
Finite list of well-defined instructions that take input and produce output.
Consists of a sequence of simple steps that start from input, follow some control flow and have a stopping rule.
Formal language used to define sequences of instructions (for computers to execute) that includes:
3.5
3.5
"cat"
'cat'
3.5 + 2
5.5
3.5 + 2
5.5
3.5 2 +
Cell In [5], line 1 3.5 2 + ^ SyntaxError: invalid syntax
"cat" + 3.5
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [1], line 1 ----> 1 "cat" + 3.5 TypeError: can only concatenate str (not "float") to str
Grace Murray Hopper popularised the term bug after in 1947 her team traced an error in the Mark II to a moth trapped in a relay.
print()
statement to check the state between proceduresExtra: Five reasons why researchers should learn to love the command line
Command (Windows) | Command (macOS/Linux) | Description |
---|---|---|
exit |
exit |
close the window |
cd |
cd |
change directory |
cd |
pwd |
show current directory |
dir |
ls |
list directories/files |
copy |
cp |
copy file |
move |
mv |
move/rename file |
mkdir |
mkdir |
create a new directory |
del |
rm |
delete a file |
Extra: Introduction to CLI
Command | Description |
---|---|
git init <project name> |
Create a new local repository |
git clone <project url> |
Download a project from remote repository |
git status |
Check project status |
git diff <file> |
Show changes between working directory and staging area |
git add <file> |
Add a file to the staging area |
git commit -m “<commit message>” |
Create a new commit from changes added to the staging area |
git pull <remote> <branch> |
Fetch changes from remote and merge into merge |
git push <remote> <branch> |
Push local branch to remote repository |
Extra: Git Cheatsheet
mkdir test
in your CLI/Terminalcd test
commandgit init
command in this directorytest.txt
in your local test repositorygit add test.txt
commandgit commit -m "Added first file"
git add <file>
would be commitedgit status
(it should say 'nothing to commit, working tree clean')git log
and make sure that you see your commithttps://github.com/<username>/<repository_name>.git
git remote add origin <project_url>
- where:
- `git remote add` is the command,
- `origin` is the name given to this link (`<remote>`), and
- `<project_url>` is the URL of the repository on GitHub
git remote -v
git remote
is the command, and-v
is the argument 'verbose'git push
command for that.git branch
to see the name of the branch you are on (it would be 'master' or 'main')git push <remote> <branch>
(e.g. git push origin master
)git push
is the command,<remote>
is the name of the remote link, and<branch>
is the name of the branch.