NCERT Solutions for Class 11 Computer Science (Python) – Introduction to Python
Very Short Answer type Questions [1 mark each]
Is Python a high-level Language ?
Yes, Python is a high-level Language.
Is Python interpreted ?
Yes, Python is a interpreted language.
Is Python Object-Oriented Language ?
Yes, Python is a Object-Oriented Language.
How many modes are available in Python ?
interactive mode and script mode.
Can Python be easily integrated with C+ + ?
Yes, Python can be easily integrated with C + +.
Is Python supports GUI applications?
Yes, Python supports GUI applications.
Does Python support automatic garbage collection ?
No, Python does not support automatic garbage collection.
Does Python support Hyper Text Markup Language?
No, Python does not support Hyper Text Markup Language.
“Python is Scalable”, is this statement true?
Can we connect Python to database ?
Yes, we can connect with all major commercial databases.
Short Answer type Questions [2 mark each]
Define Python ?
Python is a high-level, interpreted, interactive and object oriented-scripting language.
Why Python is interpreted ?
Python is interpreted because it processed at runtime by the interpreter and you do not need to compile your program before executing it. This is similar to PERL and PHP.
Is there a tool to help find bugs or perform static analysis ?
- Pychecker is a static analysis tool that finds bugs in Python source code and warns about code complexity and style.
- Pylint is another tool that checks if a module statisfies a coding standards, and also makes it possible to write plug-ins to add a custom feature.
Who developed Python?
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.
Why Python is Easy-to-learn?
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.
Write any feature of Python library.
Python library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh.
Write any one similarity between Python and OOPs
Python supports most of the OOP concepts like encapsulation, inheritance and polymorphism.
Is Python compiler language or interpreter language?
It is normally interpreted by another computer program. However subsets of the language can be compiled.
Long Answer type Questions [4 mark each]
What is the Python programming language?
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.
What is Python ? State some programming language features of Python.
- Python is a modern powerful inter-preted language with objects, modules, threads, exceptions, and automatic memory managements.
- 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.
Distinguish Java with Python
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.
Explain the disadvantages of Python.
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.
Compare C + + v/s Python.
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 + +.
How do we make Python Scripts Executable ?
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