Hi sara
number = 2899
result = 0
until number > 0
digit = number % 10
result = result + digit
number = number // 10
if number == 0 && result > 9
number = result
result = 0
say result
Programming
We are programming at the user space
Formal languages like C, C#, Java, Python etc help us in building applications/scripts by abstracting all the os level details
We have 3 possible options in any formal languages
Compiler: C, C++, Golang
Interpreter: bash, python, Ruby
Hybrid: Java, C#
When you run any application/program, OS start process. Each process will have unique id, memory and cpu shares allocated
To deal with memory, languages offer datatypes
integers
floats
string
boolean
…
Languages can be broadly classified into two types based on how they deal with datatypes
Statically typed languages:
We need to specify data type for variables
example: C, C++, Java, C#
dynamically typed languages
no need to be explicit, interpreter decides the type based on value passed
example: python, javascript, bash
Python is interpreted & dynamically typed programming (formal) language.