Python viva
1.Python inventor: Guido van Rossum
Imp:.Python is an interpreter language
An interpreter convert high level
language in to machine level language
or low level language.
Compiler also do the same, it also
convert high level language into low
level language but the interpreter do the
conversion line by line..
3. What are the basic data types
in Python? Python has several basic
data types:
Numbers: Integers (whole
numbers), floats
(decimals), booleans (True/False).
Strings: Sequences of characters
enclosed in quotes (e.g., “Hello”).
Lists: Ordered collections of
elements enclosed in square brackets
(e.g., [1, 2, “apple”]).
Tuples: Similar to lists but
immutable (cannot be changed) and
enclosed in parentheses
(e.g., (1, 2, “apple”)).
Sets: Unordered collections of
unique elements enclosed in curly
braces (e.g., {1, 2, 3}).
Dictionaries
: Key-value pairs enclosed in curly
braces
(e.g., {“name”: “John”, “age”: 30}).
Explain the difference between lists
and tuples.
Lists: Mutable (can be
changed), indexed by position
(e.g., list[0] accesses the first
element).
Tuples: Immutable, indexed by
position, often used for fixed data or
named sets.
What is a dictionary and how do you access its
elements?
Key-value pairs where keys are unique identifiers and
values can be any Python type.
Access elements by key
There are main four collection data types in the Python
programming language:
List is a collection which is ordered and changeable.
Allows duplicate members.
Tuple is a collection which is ordered and unchangeable.
Allows duplicate members.
Set is a collection which is unordered, unchangeable*,
and unindexed. No duplicate members.
Dictionary is a collection which is ordered** and
changeable. No duplicate members.
Explain the concept of conditional
statements in Python.
if, else, and elif statements control
program flow based on conditions.
Python libraries
NumPy is a Python library used for working with arrays.
It also has functions for working in domain of linear algebra, fourier
transform, and matrices.
NumPy stands for Numerical Python.
Pandas is a Python library.
Pandas is used to analyze data.
Pandas is a Python library used for working with data sets.
It has functions for analyzing, cleaning, exploring, and manipulating
data.
The name "Pandas" has a reference to both "Panel Data", and "Python
Data Analysis"
SciPy is a scientific computation library that uses NumPy underneath.
SciPy stands for Scientific Python.
It provides more utility functions for optimization, stats and signal
processing