2 | Algorithmic Thinking 1

Programming Language — Understood both by a programmer and computer.

  • Common language used to wrote solutions.

Python Language — High level (closer to human level), general-purpose, interpreted (reads code line by line), dynamic (lines can be executed while program is running), programming language.

Programming Environment — The app wherein the program is made.

Variables — Containers

  • Programmers get to name the variables

  • Contents are changeable in later statements.

Rules in Naming a Variable:

Variables – Named containers

  • Contain value of content to remember.

Post-Processing – State of an algorithm (happening in a certain point of the algorithm)

Data Types:

  • String — Enclosed with two double quotes.

    • Integer- and float-applicable variables can also be enclosed in strings, so make sure to review the code carefully!

  • Integer — Preferable for containers that use whole numbers.

  • Float — Utilizes decimals for certain variables.

  • Boolean (True or False).

Operators in Python (PEMDAS Structure):

  • Addition: +

  • Subtraction: - 

  • Multiplication: *

  • Division: /

  • Integer/Floor Division: # or //

  • Modulo (Remainder): %

Operator Precedence:

  • Positive and negative (unary operators) always take the highest precedence.

  • Divisions (/) will always result in a float data type.

  • All other operations will result in a float if one of the integers is a float.

    • This specifically includes the floor division and modulo remainder.

robot