One Pager Cheat Sheet
- This lesson covers the use of
variables
to store information, and the basics ofmath operations
in programming languages. - Variables are used to
store and manipulate data
in a programming language by using theassignment operator
(equal sign
(=)) toassign values
to the variable. - Variables can be directly initialized as
number
with value12
on both Python and JavaScript interpreters. - No valid JavaScript variable name must start with a letter, underscore (_), or dollar sign ($) and
follow camelCase naming convention
for proper syntax. - The value stored in
variable c
is equal to 10. - Programming languages allow us to perform various mathematical operations using basic arithmetic operators such as addition, subtraction, multiplication, division, modulus and exponentiation.
- You can
directly
perform math operations in Python, and save the result in new variables if needed. - Python is a powerful tool which offers rich functionality, including specific operations such as
floor division
(//
), which can be used to perform complex calculations. - In Python, additional mathematical operations not available with simple operators
can be accessed
through the Python math library by including animport
statement into the program. - The
Math.sqrt()
function is used to calculate the square root of 36 and added to 10, producing an output of 16. - The output of the
console.log()
in JavaScript is9
due to--c
being a decrement operator after variablesa
andb
were both assigned values. - Mastering basic programming concepts such as
variables
andmathematical operators
is important as they are the building blocks for further programming techniques.