This is part two in a series discussing everything required to get an all-encompassing grasp of the Python programming language in as short a time as possible. Whether you are a beginner or an expert, I intend for you to learn something new. I will not be going into details on packages that need to be downloaded and so everything will be vanilla Python.

numberVariable = 65
string_variable = "Hello World!"

Setting variables in Python is very simple. The text preceding the equals sign is the name of the variable and the text directly after, is the value to be set. This value can come in various forms, however the examples above show a number and a string. Python does not require you to specify the data type when creating the variable.

Naming Variables

When creating a variable name, it is best to make it as descriptive as possible while keeping it concise. This helps the code be readable and is a good skill to develop for working in the industry and sharing code among teams. If the variable’s name is more than one word, there is a few ways to write the name.

#python-programming #python3 #variables #python

Creating variables correctly in Python
2.60 GEEK