Chapter 7 Introduction to Python Solutions
Question - 11 : - Who developed Python?
Answer - 11 : -
Python was developed by Guido van Rossum in the late eighties and early nineties at the National Research Institute for Mathematics and Computer Science in the Netherlands.
Question - 12 : - Why Python is Easy-to-learn?
Answer - 12 : -
Python has relatively few keywords, simple structure, and a clearly defined syntax. This allows the student to pick up the language in a relatively short period of time.
Question - 13 : - Write any feature of Python library.
Answer - 13 : -
Python library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh.
Question - 14 : - Is Python compiler language or interpreter language?
Answer - 14 : -
It is normally interpreted by another computer program. However subsets of the language can be compiled.
Question - 15 : - What is the Python programming language?
Answer - 15 : -
Python is an interpreted, interactive, object- oriented programming language. It is often compared to Tel, Perl, Scheme or Java.
It is a scripting language like Php or Asp for developing applications. Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python’s simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
Question - 16 : - What is Python ? State some programming language features of Python.
Answer - 16 : -
1. Python is a modern powerful inter-preted language with objects, modules, threads, exceptions, and automatic memory managements.
2. Python was introduced to the world in the year 1991 by Guido van Rossum
Salient features of Python are :
- Simple & Easy : Python is simple language & easy to learn.
- Free/open source : Everybody can use python without purchasing license.
- High level language : When coding in Python one need not worry about low-level details.
- Portable : Python codes are Machine & platform independent.
- Extensible: Python program supports usage of C/ C + + codes.
- Embeddable Language : Python code can be embedded within C/C+ + codes & can be used a scripting language.
- Standard Library : Python standard library contains prewritten tools for programming.
- Built-in Data Structure : Contains lots of data structure like lists, numbers & dictionaries.
Question - 17 : - Distinguish Java with Python
Answer - 17 : -
Java v/s Python :
- Python programs run slower than the Java codes, but Python saves much time and space. Python programs are 3-5 times smaller than Java programs.
- Python is a dynamic typed language. Python programmers don’t need to waste time in declaring variable types as in Java.
- Python is much more easy to learn than Java.
Question - 18 : - Explain the disadvantages of Python.
Answer - 18 : -
Disadvantages of Python are :
- Python is not the best for memory intensive tasks.
- Python is interpreted language and is slow compared to C/C+ + or java.
- Python is not a great choice for a high graphic 3D game that takes up a lot of CPU.
- Python is evolving continuously with constant evolution there is little substantial documentation available for the language.
Question - 19 : - Compare C + + v/s Python.
Answer - 19 : -
C+ + v/s Python
- Comparison is same as that between Java and Python except the program length in python is 5-10 times shorter than that in C + + .
- Python programmers can complete a task in 2 months that takes a year in C + +.
Question - 20 : - How do we make Python Scripts Executable ?
Answer - 20 : -
Python scripts can be executed in two ways :
- Open the script1.Py in IDE Editor and run the script in the frontmost window of the Python IDE by hitting the run all button.
- Using command prompt by making sure PATH is appropriate directly type script name. > > > python Script1.Py