This article is a part of a challenge series on Python. You can find the link to the previous articles in this series here:
- 30 Days of Python 👨💻 - Day One - Introduction
- 30 Days Of Python 👨💻 - Day 2 - Data Types I
- 30 Days of Python 👨💻 - Day 3 - Data Types II
Introduction
Before diving deep into the nitty-gritty details of a programming language or perhaps even a human language, we need
to understand its terminologies and basic principles and start building a basic mental model which we can come back and
refer whenever needed.
The building block of any programming language can be divided mainly into the following:
- Terminologies
- Data Types
- Actions (functions)
- Best Practices
I spent today understanding some basic Python terms, syntax, its data types and some of its actions or better known
as functions in programming terms.
Data Types
Data Types in simple words are a way to represent values. In our physical world, we have letters, numbers, symbols as
different types of commonly used values. Similarly, Python is comprised of these fundamental data types:
- int (to represent numbers)
- float (to represent decimal numbers)
- str (to represent strings)
- bool (to represent boolean)
- list
- tuple
- set
- dict
- complex (not used very often)
- None (to represent an absence of value)
These are the standard data types available in Python. To create our own custom type, classes are used. Specialized data
types can also be used via importing external libraries or modules.
In contrast, in JavaScript, these are the following primitive types available:
- number (for both whole and decimal numbers)
- string
- boolean
- symbol
- bigInt
- null
- undefined - Also, object as a non-primitive type.
Numbers
There are 3 types of numeric data types,
- int (stores whole numbers of unlimited size)
- float (stores floating-point real number values)
- complex (I just skipped it as of now as I learnt it is not used commonly, similarly to bigInt in JavaScript).
In contrast, JavaScript has two kinds of numeric data types, Number and BigInt.
The
type function is used to determine the type of a value or an expression. (Similar to the typeof operator in
JavaScript)- num = 100 # variable assignement
- print(type(num)) # <class 'int'>
- num2 = 99.99
- print(type(num2)) # <class 'float>
- expression1 = num * 10
- print(type(expression1)) # <class 'int'>
- expression2 = num + num2
- print(type(expression2)) # <class 'float'>
In Python, variable assignment happens by just writing a name and assigning a value using the
= operator.
In JavaScript, a variable name needs to be preceded with var, const or let keyword.Math functions
There are some built-in mathematical functions that allow us to calculate various mathematical operations with ease.
Math Functions and Constants - this document contains all the built-in
math functions and constants

Join the conversation! Your thoughts help the community grow.