RE: RE: What is a variable in Python?
You are viewing a single comment's thread from:

RE: What is a variable in Python?

RE: What is a variable in Python?

This is a good article, but since you're using the python tag, you should use Python conventions in your code examples. It would also help to explain the difference between the numeric types.

For example, Circle_Area should be circle_area, as it's more pythonic to use lower case for variable naming. Also, current_Lad should be current_lad. Combining snake and camel case is not good pythonista practice. Snake case is the Python norm.

As for the variable types:

Python supports four different numeric variable types: int, long, float, and complex

An example of each is below:
int - 10
long - 086498263L
float - 3.14159
complex - 2e+24J

Variables are distinguished by the Python run-time by how they look. All the variables above have something that gives them a unique identity, such as the "L" in the long variable, and the decimal in the float.

Strings are declared by just surrounding text in double quotes:
my_first_string = "this is a string"

there are other variable types and much more potential detail to dive into, but I intended this response to just be a gist of constructive tips.

That's about it! Great article! I don't mean any of this to sound negative in any way! I am merely a Python enthusiast who wanted to offer a few points of constructive criticism.

Have a great day and I wish you luck with writing your programming tutorials!

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center