Python Classroom notes 10/Dec/2024

Programming

  • Programming is used generally to build applications & Scripting to automate the workflow
  • Applications:
    • Command line applications
    • Desktop Applications
    • Mobile Applications
    • Web applications
  • Technologies used to Develop
    • Command Line Application:
      • java, C, C++, Python, C#, node js …
      • bash or powershell
    • Desktop Applications:
      • C#, node js, python…
    • Mobile Applications:
      • Kotlin
      • Swift
      • react native (java script frameworks)
    • Web Applications:
      • java, Python, C#, node js …
      • angular, react, vue
      • HTML, CSS, Javascript
  • How does program run ?
    • Operating systems create process
    • Application will be single process or multiple processes
    • Each process has a unique id (PID) and it gets cpu and memory
    • memory stores the necessary data for application
    • cpu is executing the instructions
    • Options:
      • Compiler: Programs are converted into instructions which OS understands
      • Interpretor: Programs are translate while execution.
      • Hybrid

How to write programs ?

  • Approach: Find out more in classroom recording
    Preview
    Preview
    Preview

Problem 1:

  • Lisa knows how to add numbers
  • instruction format
add 3 & 5
  • Make her multiply 5 * 5
  • Solution: Represent the problem
    • add 5 + 5 + 5 + 5 + 5

Probem 2:

  • Lisa knows how to
    • multiplication
    • division
    • remainder
    • addition
  • Example: Sum the number plate
  • 432 => 4 + 3 + 2 => 9
  • 164 => 1 + 6 + 4 => 11 => 1 + 1 => 2
  • Problem: my number number is 414
    • 414 % 10 => 4
    • 414 /10 => 41
    • 41 % 10 => 1
    • 41 /10 = 4
    • 4 % 10 = 4

Understanding memory allocations

  • Allocating memory requires specifying size and generally we get a memory address
  • Programming languages use data types where we indirectly specify sizes
  • to access memory locations we take help of references (Variables or constants)
int i = 10;
string name = "hello" ;
  • We have needs for memory sizes
    • fixed size: these are referred as mutable types
    • variable size: new memory has to be allocated for every change.
  • Programming Languages: Support two types
    • Automatic memory cleaning (Garbage collection)
    • Manual memory cleaning
  • Static Typed Languages and Dynamically Typed Languages
    • In Static typed languages (C, C++, Java, C#) we need to specify type for every memory allocation and in dynamically typed languages (python, javascript, bash) type is decided based on value passed to it

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube