{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Quick Intro to Programming\n", "\n", "- A program is a sequence of instructions that tell a computer how to do a task. When a computer follows the instructions in a program, we say it executes the program.\n", "\n", "- Hence, programming is about writing efficiently a sequence of instructions to execute a given task.\n", "\n", "\n", "### The Natural Language of the Computer\n", "\n", "- Machines have their natural language like humans do. Computers do not understand the human language. The natural language of computers is the binary code — 1 and 0. These represent two states: on **(1)** and off **(0)**.\n", "\n", "\n", "#### Decimal vs Binary\n", "\n", "Here are some equivalent values:\n", "\n", "---------------------------------------------------------------------------\n", "|Decimal: | 0 | 1|\t2|\t3|\t4|\t5|\t6|\t7|\t8|\t9|\t10|\t11|\t12|\t13|\t14|\t15|\n", "|--- | ---| ---|---| ---|---| ---|---| ---|---| ---|---| ---|---| ---| ---| ---| \n", "|Binary: |\t0 | 1\t|10|\t11|\t100|\t101|\t110|\t111|\t1000|\t1001|\t1010|\t1011|\t1100|\t1101|1110| 1111 |\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- To communicate with machines who speak binary, we do so in a language that’s closer to our own natural language. Such as English, French, Swahili or Arabic. Programming languages are close to our natural languages. But they are more structured and must be thoroughly learned.\n", "\n", "\n", "- They could be **high level** or **low level** languages. \n", "\n", "High level programming languages (i.e. Python) are farther away from the machine language than low level languages (i.e. Fortran). This “farther away” is usually called an abstraction.\n", "\n", "In any case, the original script needs to be translated into machine language.\n", "\n", "\n", "There are two main ways of doing this:\n", "\n", "1. **Compilers**\n", "2. **Interpreters**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## What is Python?\n", "\n", "- Python is an interpreted high-level programming language for general-purpose programming.\n", "\n", "- Created by Guido van Rossum and first released in 1991. \n", "\n", "- Emphasizes code readability.\n", "\n", "- Very intuitive with elegant object-oriented programming.\n", "\n", "## Why Python?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![rankings](https://11m5ki43y82budjol1gjvv5s-wpengine.netdna-ssl.com/wp-content/uploads/2018/02/Stack-overflow.jpg)\n", "\n", "\n", "\n", "- Open-source language.\n", "- Massive user community.\n", "- Vast collection of standard and external software libraries. Knowledge of Python is a highly marketable skill.\n", "- General-purpose language." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## How to Run Python?\n", "\n", "1- **Python Shell**\n", " - terminal/command prompt\n", "\n", "2- **Jupyter Notebooks**\n", " - Very useful for experimenting and tutoring \n", " \n", "3- **IDE (Integrated Development Environment)**\n", " - A software that helps you build code. Two of the most famous being Spyder and PyCharm." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.3" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }