PROGRAMMING

Cards (162)

  • Computer
    A machine that performs a variety of tasks according to specific instructions. It is a data processing machine which accepts data via an input device and its processor manipulates the data according to a program.
  • Basic components of a computer
    • The CPU
    • Memory
  • CPU (Central Processing Unit)

    The processor is the "brain" of the computer. It contains millions of extremely tiny electrical parts.
  • Types of Memory
    • Primary Memory
    • Secondary Memory
  • Primary Memory (RAM)
    Volatile (temporary storage), used for temporarily storing data that the CPU is actively using or processing, faster access, smaller capacity
  • Secondary Memory (Storage)
    Non-volatile (retains data even when the power is turned off), used for long-term storage of data and programs, slower access, larger capacity
  • Input and Output Devices
    Allow a computer system to interact with the outside world by moving data into and out of the system
  • Python
    A high-level, general-purpose, and very popular programming language
  • Python programming language
    • Used in web development, Machine Learning applications, along with all cutting-edge technology in Software Industry
  • Software
    The program that a computer uses in order to function. It is kept on some hardware device like a hard disk, but it itself is intangible.
  • Python
    • Free and open-source - You can freely use and distribute Python, even for commercial use
    • Easy to learn - Python has a very simple and elegant syntax. It's much easier to read and write Python programs compared to other languages like C++, Java, C#
    • Portable - You can move Python programs from one platform to another, and run it without any changes
  • Types of Computer Programs
    • System Programs
    • Application Programs
    • Compilers
  • Python's standard library can be used for
    • Machine Learning
    • GUI Applications (like Kivy, Tkinter, PyQt etc.)
    • Web frameworks like Django (used by YouTube, Instagram, Dropbox)
    • Image processing (like OpenCV, Pillow)
    • Web scraping (like Scrapy, BeautifulSoup, Selenium)
    • Test frameworks
    • Multimedia
    • Scientific computing
    • Text processing and many more
  • Why Learn Python?
    Python is currently the most widely used multi-purpose, high-level programming language, which allows programming in Object-Oriented and Procedural paradigms
  • System Programs
    Programs that are needed to keep all the hardware and software systems running together smoothly
  • Application Programs
    Programs that people use to get their work done
  • Python Syntax
    • Python was designed for readability, and has some similarities to the English language with influence from mathematics
    • Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses
  • Compilers
    The computer understands only one language: machine language. Machine language is in the form of ones and zeros.
  • Installing the Python Interpreter on Windows

    1. Go to https://www.python.org/downloads and click on Download Python 3.X.x
    2. Once the installer's finished downloading, go to the folder in your computer where you saved it, and double click it
    3. Be sure that Add Python 3.9 to PATH is checked, then click on Customize installation
    4. Be sure that the tcl/tk and IDLE option is checked, then click on Next
    5. Check Install for all users, change the install location to: C:\Python3, then click on the Install button
  • Programming Language
    A standardized communication technique for expressing instructions to a computer. Like human languages, each language has its own syntax and grammar.
  • Installing the Python Interpreter on Linux
    1. Access your CLI terminal ctrl + alt + t
    2. Update your distro with sudo apt-get update -y
    3. Install python3 with sudo apt-get install python3 -y
    4. Code on your desired text editor or use VIM/nano, then type python to execute the interpreter mode
  • Brief history of computer programming
    • Early Years (1801-1936)
    • Punch Cards and Assembly Language (1940s)
    • Fortran (1957)
    • Lisp and ALGOL (1958)
    • COBOL (1959)
    • C and Unix (1970s)
    • Pascal (1970)
    • C++ (1983)
    • Python (1989)
    • Java (1995)
    • .NET and C# (2000)
    • Web Technologies (2000s)
    • Mobile App Development (2000s)
    • Modern Era (2010s-Present)
    • Machine Learning and AI (2010s-Present)
  • Variables
    • Storage locations that have a human-readable name
    • Name-value pairs
    • Case sensitive
    • Must start with a letter, can contain numbers or underscores
    • No need to indicate a variable's datatype in Python because it is a Dynamic Typed language
  • Categories of Programming Languages
    • High-level Programming Languages
    • Low-level Assembly Language
  • High-level Programming Languages

    More user-friendly, to some extent platform-independent, and abstract from low-level computer processor operations such as memory accesses
  • Datatypes
    • String
    • Integer
    • Float
    • Boolean
    • Bytes
  • Assembly Language
    Similar to machine languages, but much easier to program in because they allow a programmer to substitute names for numbers
  • Program Development Life Cycle
    • Problem Definition
    • Problem Analysis
    • Algorithm design and representation (Pseudocode or flowchart)
    • Coding and debugging
  • Datatypes - String
    • Hello123world = 'test'
    • hello_world = "test"
    • helloWorld = '"test"'
    • _ = "\"hi there! \""
  • Problem Definition
    A clearly defined problem is already half the solution. Computer programming requires us to define the problem first before we even try to create a solution.
  • Datatypes - Boolean
    • a = 1 > 2
    • b = True
    • c = False
  • Problem Analysis
    Determine the input to the program, the output of the program, and the steps needed to transform the input to the output.
  • input()
    A built-in string function which accepts a keyboard input from the user and on enter this input is interpreted as a string data
  • Program
    A set of instructions written in a programming language to perform tasks
  • Algorithm
    A clear and unambiguous specification of the steps needed to solve a problem. It may be expressed in either Human language, through a flowchart or through a pseudocode.
  • print()
    A built-in function which outputs string data for the user to see on a terminal or shell
  • Flowchart Symbols and their meanings
    • Start/Stop
    • Process
    • Decision
    • Input/Output
    • Connector
  • Important elements of program
    • Data: Information such as facts and numbers upon which operations are performed
    • Instructions: A set of steps to perform operations upon data
  • String Concatenation
    The plus (+) sign is used to concatenate two or more string data in Python
  • These are some points to keep in mind while developing a flowchart: