PYTHON LEARNING NOTES

Everything You Need To Know About Python Data Types & Variables

Crash Course Into Python Part 1 With Cheatsheet At The End

Aphinya Dechalert
Modules&Methods
Published in
7 min readJun 22, 2021

--

image by Aphinya Dechalert

Starting with the Basics

In a nutshell, a variable is a memory location where you can store a value. This value may or may not change in the future. In Python, the declare a variable, you just have to assign a variable to it.

For example:

x is assigned the integer value of 5. There are no additional commands or type declaration, unlike other programming languages.

You can also perform operations on these variables using arithmetic operators (eg: + , , * , and %). If you declare a variable without assigning a value to it, it will give you a NameError .

Here is an example of what the error looks like if we declare x without any assignments:

Variables in Python are case sensitive, which means that y is considered as different from Y.

Variable Data Types

--

--

Modules&Methods
Modules&Methods

Published in Modules&Methods

Code. Dev. Design. Anything and everything with a dash of caffeine.

Aphinya Dechalert
Aphinya Dechalert

Written by Aphinya Dechalert

Where Development Meets Storytelling: Tech Writer, Editor & Dev Advocate. Translating Complexity into Clarity. DM me. linkedin.com/in/dechalert