Different Python Versions:
Over the years there have been many improvements made in this programming language which has led to the development of many Python versions.
- The very first from the Python versions i.e. Python 1.0 was introduced in January 1994.
- Six years later came the Python 2.0 in October 2000
- Then the Python 3.0 was introduced in December in the year 2008.
- The most recent version of them being the Python 3.6.3 which was introduced in 2016.
- According to the usual convention that newer versions of the software must provide support to the older versions as well. But this is not followed by Python since the version 3 does not render any support for version 2.
- It does not provide backward compatibility as doing so would mean that many essential features that newer versions hold may not be implemented properly.
For example:
print(“Welcome”)
Note – It is mandatory in Python 3.0 to use ( ) in the print statement unlike the version 2.0.
Note – The long data type is present in Python 2.0 but not in Python 3.0.
Various Python Implementations:
Being an open source software it is very likely that developers across the world will add some different characteristics to it which might make it different from its original form. Some of the more popular versions are:-
- CPython– It is the standard version of Python. It is used to work with C language and develop applications.
- Jython or Python– This version is used along with java to develop Java applications.
- IronPython– This python version is developed to work with C Sharp and .NET platforms.
- Pypy– Pypy is used whenever high performance is required in the applications. In the Python Virtual Machine, we have JIT (Just-In-Time) compiler which makes the performance better in general.
- RubyPython– When we need to work with Ruby-based applications then this is used.
- AnacondaPython– This version is specially used for manipulation of the huge amount of data.
- Stackless– When multiple tasks are to be handled at once then this is used for concurrency.
Identifiers in Python:
It can be defined as anything in the program that we use to name a variable, function or class etc. However, there also exists a set of rules that one must follow while naming or defining identifiers. They are:-
- The characters allowed in Python identifiers are:-
- Both uppercase and lowercase alphabets can be used.
- Digits from 0 to 9 can be included.
- Underscore (_) is allowed.
Example:
# Identifier having valid name >>>Meow = 10 # Print the variable print(Meow)
OUTPUT:
10
Program –
# Identifier having invalid name having special character [$] >>>M$ow = 10 # Print the variable print(M$ow)
OUTPUT:
ERROR
In above program we have included the special character [$] in name , hence it will give error
- Identifiers must not begin with a digit
# Identifier starts with number >>>321Meow = 10 # Print the variable print(321Meow)
OUTPUT:
ERROR
- The identifiers in Python are case sensitive and hence ‘a’ and ‘A’ will both be treated differently.
# small letter meow variable >>>meow = 10 # Capital letter meow variable >>>MEOW = 100 #print variable print(meow) #print variable print(MEOW)
OUTPUT:
10 20
Here we can see that although both the names were same but due to the difference in case it was treated differently.
- Keywords or reserved words are not allowed in defining identifiers.
#variable name is reserved keyword >>>return = 10 #print variable name print(return)
OUTPUT:
ERROR
The above program is giving error as variable is keyword.
Note: There are no limits to taking a specific number of characters while defining an identifier.
- An identifier starting with (underscore) ‘_’ denotes that it is private
- An identifier starting with (double underscores) ‘__’ denotes that it is strongly private
- An identifier starting with (double underscores) ‘__’ and ending with ‘__’ denotes that it is a language-specific identifier i.e. a special variable.
- Having discussed the various features and limitations of Python it is also a fact that Python is not completely an object-oriented language.
- It has undoubtedly proven its importance in many fields but some myths still revolve around the fact that Python may not be really suitable for large-scale enterprise applications. However, nothing substantial can be stated about this as it still needs more time to be discovered.