Explain the features of Python / Say something about the benefits of using Python?
- Learning a python programming language is easy and fun.
- Compared to another language, like, Java or C, its syntax is a way lot easier.
- You also don’t have to worry about the missing semicolons (;) in the end!
- It is more expressive means that it is more understandable and readable.
- It supports the development of a wide range of applications from simple text processing to WWW browsers to games.
- This makes it easy for Beginners to learn a language quickly.
- Python code is a simple clearly defined structure and readable. It’s almost like plain and simple English.
Features of Python:
Python is Interactive Language −
- You can open the interactive terminal also referred to as Python prompt and interact with the interpreter directly to write your programs.
Python is Object-Oriented oriented language −
- Python will support functional, structured programming methods but and Object-Oriented Principles also.
Scripting Language —
- Python we can use as a scripting language. python language will compile to byte code for building large scale applications.
Large Open Source Community —
- Python has a large open-source community and which is one of its main strengths.
- Python libraries, from open source 118 thousand plus and counting.
- If you are stuck with an issue, you don’t have to worry at all because python has a huge community for help.
Cross-platform Language —
- Python is a Cross-platform language or Portable language.
Is Python interpreted or compiled?
compile means to convert a program in a high-level language into a binary level language its means machine code formate (CPU instructions). When you compile a C program, this is what happens. The result is a file that your operating system can run for you.
In the simple definition of interpreted, executing a program means reading the source code a line at a time, and doing what it says. Compiling is a more general idea: take a program in one language (or form), and convert it into another language or form. In Python, the source code is compiled into a much simpler form called bytecode. the byte code instructions are similar in spirit to CPU instructions, but this instruction is executed by a software called a virtual machine.
So, if you can explain all this, then you can say its both a compiled and interpreted language.
But, if you want to give a simple and short answer, then say it is an interpreted language.
what are the supported data types in python?
in phython have five dta types this are standed types
What is PYTHONPATH?
PYTHONPATH is an environment variable can be set, to add additional directories where python will look for modules and packages.
Whenever a module is imported, PYTHONPATH is also looked up to check for the presence of the imported modules in various directories.
What are Python modules?
Python modules are files containing Python code.
A module can define functions, classes, and variables. A module can also include runnable code. types of code (group code) into a module makes the code easier to understand and use.
How many types are namespace in python?
3 types of namespace are classified in phython
- Local Namespace
- Global Namespace
- Built-in namespace
Explain some of the areas where we can use Python
Databases − Python provides interfaces to all major commercial databases. There by making it useful to create tools or GUI of databases, and also to use with an application which involves interacting with data.
Web Applications –
- We can use Python to develop web applications.
- Python to handle internet protocols such as HTML and XML, JSON, Email processing, request, beautiful soup, Feedparser, etc.
- There are many well-known web Frameworks such as Django, FastAPI, Pyramid, Flask, etc to design and develop web-based applications.
Desktop GUI Programming −
- Python supports GUI applications that can be installed and run locally on systems like Windows, Linux, iOS, etc.
- Python provides develop user interface in python based application.
- Python provides useful toolkits wxWidgets, Kivy, pyqt that are useable on several platforms.
BigData and Data Science –
- Python and Big Data is an inseparable combination when we consider a programming language for the big data development phase. Being Open Source, wide community, and a huge library, its best suited for Big Data projects.
- Python has become the number 1 language in Data Science projects.
- Some important packages Pandas, Numpy, SciPy, Theano, Scikit-learn, etc provide everything that a developer needs to work on Big Data and machine learning projects.
- PySpark is also an example of its use.
- Compatible with Hadoop. As Python big data is compatible, similarly Hadoop and big data are synonymous with each other. Hence, Python has been made inherently compatible with Hadoop to work with big data.
- An example is IBM using python, they even have a Python SDK for Watson, and they use Python extensively.
- Netflix, Spotify uses extensively for their recommendation and analytics engine.
Console Based Application –
- We can use Python to develop console-based applications. IPython is the best example of this.
Multimedia Applications –
- Python is awesome to perform multiple tasks and can be used to develop audio and video applications.
Python is can also be used to develop
- 3D CAD Applications
- Enterprise Applications
- Image Processors and editors
How do you make use of an array in python?
phython doent support arrays,but you can use list collections types which can store an unlited numbers of elemnts
How is Exception Handling done in Python?
There are 3 main keywords
which are used to catch exceptions and handle there covering mechanism accordingly.
Try is the block of a code which is monitored for errors.
Except block gets executed when an error OcCurs. the beauty of the final block is to execute the code after trying for error. This block gets executed irrespective of whether an error occurred or not.
Finally, the block is used to do the required cleanup activities of objects/variables.
What are the different environment variables identified by Python?
- PYTHONPATH: This environment variable helps the interpreter as to where to locate the module files imported in the program.
- PYTHONSTARTUP: This environment variable contains the path of the Initialization file containing source code.
- PYTHONCASEOK: This variable is used to find the first case-insensitive match in the import statement
What are a help ( ) and dir( ) in python?
help ( ) is a built-in function that can be used to return the Python documentation of a particular object, method, attributes, etc.dir ) displays a list of attributes for the objects which are passed as an argument. If dir) is without the argument then it returns a list of names in current local space