Subj DynamicLanguage
Subj DynamicLanguage
These behaviors could include extension of the program, by adding new code, by extending objects
and definitions, or by modifying the type system.
This is opposed to so-called static programming languages, in which such changes are normally
not possible
❑ Numerous languages fall into the dynamic category, including JavaScript, VBScript, Lisp,
Perl, PHP, Python, Ruby and Smalltalk. Examples of languages that are not dynamic are
C/C++, Java, COBOL and FORTRAN.
String (str)
Tuple (tuple)
Range (range)
List (list)
Set (set)
Dictionary (dict)
NumPy
SciPy
TensorFlow
SciKit
Seaborn
Matplotlib
Lists and tuples are classes in Python that store one or more objects or values. Key differences
include:
Syntax – Lists are enclosed in square brackets and tuples are enclosed in parentheses.
Mutable vs. Immutable – Lists are mutable, which means they can be modified after being created.
Tuples are immutable, which means they cannot be modified.
Operations – Lists have more functionalities available than tuples, including insert and pop
operations, as well as sorting.
Size – Because tuples are immutable, they require less memory and are subsequently faster.
Series only support a single list with index, whereas a dataframe supports one or more series. In
other words:
Series is a one-dimensional array that supports any datatype (including integers, strings, floats,
etc.). In a series, the axis labels are the index.
A dataframe is a two-dimensional data structure with columns that can support different data
types. It is similar to a SQL table or a dictionary of series objects.
6. What is __init__() in Python?
Purpose:
Example:
We have created a book_shop class and added the constructor and book() function. The
constructor will store the book title name and the book() function will print the book name.
To test our code we have initialized the b object with “Sandman” and executed the book() function.
class book_shop:
# constructor
self.title = title
# Sample method
def book(self):
b = book_shop('Sandman')
b.book()