Assignment 1
Assignment 1
Data analytics tends to focus more on analyzing past data to inform decisions in the
present, while Data science often involves using data to build models that can predict
future outcomes.
Data: Supervised learning requires labeled data; unsupervised learning does not.
Applications: Supervised learning is used for tasks where the outcome is known, like
classification and regression. Unsupervised learning is used for exploring the data's
structure, like clustering and anomaly detection.
4. What is python?
Web development.
Game developement.
Machine learning.
Artificial intelligence.
Natural language processing.
Python is compiled interpreted language, with the interpreter executing the code line by
line.Python source code is first compiled to bytecode, which is then executed by the
Python virtual machine.
1. `len()`
Example 1:
length = len(text)
print(length) # Output: 13
2. `upper()`
The `upper()` method returns a new string with all characters converted to uppercase.
Example 2:
uppercase_text = text.upper()
3. `lower()`
The `lower()` method returns a new string with all characters converted to lowercase.
Example 3:
lowercase_text = text.lower()
4. `replace()`
The `replace()` method returns a new string with all occurrences of a specified
substring replaced by another substring.
Example 4:
5. `split()`
The `split()` method splits a string into a list of substrings based on a specified
delimiter (default is any whitespace).
Example 5:
words = text.split()
A variable name can only contain alpha-numeric characters and underscores (A-z,
0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different
variables)
1. Easy to Maintain
2. Expressive Language
3. Extensible
4. Interpreted Language
5. High-Level Language
6. Cross-platform Language
9. Object-Oriented Language
12. Interactive
13. Databases Support
The top Python libraries include NumPy, Pandas, Matplotlib, TensorFlow, PyTorch, Scikit
-learn, Requests, Keras, Seaborn, Plotly, NLTK, Beautiful Soup, Pygame, Gensim, spaCy,
SciPy, Theano, PyBrain, Bokeh, and Hebel.
1. Django
2. Flask
3. CherryPy
4. Web2py
5. Bottle
6. Pyramid
7. Falcon
8. Tornado
9. Hug
10. BlueBream
Python 3's syntax is considered easier to understand and more readable than Python 2's,
which uses more complex syntax.
A document that provides guidelines and best practices on how to write Python code. It
was written in 2001 by Guido van Rossum, Barry Warsaw, and Alyssa Coghlan. The
primary focus of PEP 8 is to improve the readability and consistency of Python code.
Yes, Python is a fully object-oriented programming language. It supports all the major
features of object-oriented programming (OOP).
xyz = 1,000,000
x_y_z = 1,000,000
The variable names cannot have spaces, so `x y z` is not a valid variable name. The
other statements are valid Python variable assignments.
Polymorphism in Python refers to the ability of different objects to respond to the same
method or function in different ways. It allows objects of different classes to be treated
as objects of a common superclass. This enables code to be more generic and flexible,
as it can operate on objects of different types without needing to know the specific type.
Polymorphism allows for code reuse, abstraction, and flexibility in Python programming,
making it a powerful feature of the language