You are on page 1of 2

PYTHON ASSIGNMENT

NAME – Kushagra Singh Chauhan


Roll NO- 2100911530027

Q.1 - Which Data type are supported in python?

Ans.1- Python has an array of built-in data types, including:

 Boolean
 Numeric (Integers, Long, Float, Complex)
 Sequences (Lists, Strings, Byte, Tuple)
 Sets
 Mappings (Dictionaries)
 File objects

Q.2 – What are the key features of python?


Ans.2-

Free and Open Source  → Python is a open sourced language. Thus it is publicly available to
download and use and even anyone can contribute to its development.

1. Easy to maintain  →    Python codebase is very easy to maintain.


2. Object Oriented Language  →  Python is an Object Oriented language. Thus is provides all the
key features of an Object Oriented Programming language like Encapsulation, Inheritance,
Abstraction and Polymorphism. Nevertheless, Python also offers a scope to write code as in a
Procedural Programming Language.
3. GUI Support  →  Python provides support for Graphical User Interface design such as Skinter
and PyQt5.
4. Extensibility  →  Python is very extensible. We can write and integrate some Python code into
C and C++ and hence compile it using its irrespective compilers.
5. Portability  →  Python provides high portability. Thus same piece of code can be run in all
platforms of Windows, Unix and Linux.
6. Large Standard Library  →  Python has a large set of large standard library which possess
some inbuilt rich set of functions such that we need not to write code for every single thing.

Q.3- what happens if you put a semi colon in python?

ANS.3 - Python does not require semi-colons to terminate statements. Semicolons can be used to
delimit statements if you wish to put multiple statements on the same line. A semicolon in Python
denotes separation, rather than termination. It allows you to write multiple statements on the same
line.

Q.4 – What is python? How python interprets? What are python decorators?
Ans.4- 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.

Python decorators show how the Python programming language packs several features in
your small and beneficial package. Decorators can be applied to classes and functions to make
programming fascinating. They can speed up the performance, shorten and completely change the
dynamics of what the code can do.

Q.5 – Explain condition statement in python?

Ans.5- Conditional Statement in Python perform different computations or actions depending


on whether a specific Boolean constraint evaluates to true or false. Conditional statements
are handled by IF statements in Python. Python if Statement is used for decision-making
operations. It contains a body of code which runs only when the condition given in the if
statement is true. If the condition is false, then the optional else statement runs which
contains some code for the else condition.
When you want to justify one condition while the other condition is not true, then you use
Python if else statement.

if expression
Statement
else
Statement

You might also like