0% found this document useful (0 votes)
12 views

Assignment 1

Uploaded by

vijay Gaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Assignment 1

Uploaded by

vijay Gaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Assignment 1

1. What is data Science ?

Data science is an interdisciplinary field that uses scientific methods, processes,


algorithms, and systems to extract knowledge and insights from structured and
unstructured data.

2. Differentiate between Data Analytics and Data Science?

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.

3. What are the differences between supervised and unsupervised learning?

Data: Supervised learning requires labeled data; unsupervised learning does not.

Objective: Supervised learning aims at prediction based on input-output mapping;


unsupervised learning aims at finding patterns or structures in the data.

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?

Python is a high-level, interpreted programming language known for its


simplicity,readability and extensive ecosystem make it a versatile and powerful
language suitable for a wide range of applications, from web development and
automation to data science and machine learning. Its community support and continual
development ensure that Python remains a popular and relevant choice for
programmers and organizations worldwide.

5. List some popular applications of python in real world technology?

 Web development.

 Game developement.

 Machine learning.

 Artificial intelligence.
 Natural language processing.

6. Is Python a compiled language or an interpreted language?

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.

7. List and illustrate any 5 string functions?

1. `len()`

The `len()` function returns the length of a string.

Example 1:

text = "Hello, World!"

length = len(text)

print(length) # Output: 13

2. `upper()`

The `upper()` method returns a new string with all characters converted to uppercase.

Example 2:

text = "Hello, World!"

uppercase_text = text.upper()

print(uppercase_text) # Output: "HELLO, WORLD!"

3. `lower()`

The `lower()` method returns a new string with all characters converted to lowercase.
Example 3:

text = "Hello, World!"

lowercase_text = text.lower()

print(lowercase_text) # Output: "hello, world!"

4. `replace()`

The `replace()` method returns a new string with all occurrences of a specified
substring replaced by another substring.

Example 4:

text = "Hello, World!"

new_text = text.replace("World", "Python")

print(new_text) # Output: "Hello, Python!"

5. `split()`

The `split()` method splits a string into a list of substrings based on a specified
delimiter (default is any whitespace).

Example 5:

text = "Hello, World!"

words = text.split()

print(words) # Output: ['Hello,', 'World!']

8. What is variable in python?

Python variable is a reserved memory location to store values.

Rules for Python variables:

 A variable name must start with a letter or the underscore character.


 A variable name cannot start with a number.

 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)

9. How is memory management done in Python?

Python's memory management combines reference counting, garbage collection, and


memory pooling to efficiently manage memory. This allows developers to focus on
writing code without worrying about manual memory management, which can be
complex and error-prone.

10. What is dynamically typed language?

Dynamically-typed languages where the interpreter assigns variables a type at runtime


based on the variable's value at the time.

11. What are the key features of Python?

1. Easy to Maintain

2. Expressive Language

3. Extensible

4. Interpreted Language

5. High-Level Language

6. Cross-platform Language

7. Broad Standard Library

8. Free and Open Source

9. Object-Oriented Language

10. Dynamic Typed

11. GUI Support

12. Interactive
13. Databases Support

14. Easy to Learn and Use

12. What do you mean by python Libraries? List 10 python Libraries.

In Python, a library is a collection of modules that contain pre-written code to help


perform common tasks. These libraries simplify the process of coding by providing
reusable functions and classes, which can significantly reduce development time and
improve code quality.

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.

13. List 10 different frameworks used in Python?

1. Django

2. Flask

3. CherryPy

4. Web2py

5. Bottle

6. Pyramid

7. Falcon

8. Tornado

9. Hug

10. BlueBream

14. What are the differences between python 2 and Python 3?

Python 3's syntax is considered easier to understand and more readable than Python 2's,
which uses more complex syntax.

15. What is the difference between modules and libraries?


A module is a piece of code that may be built upon, a package is a collection of
modules, a library is a collection of pre-written code, and a framework is a set of
principles for developing applications.

16. What is PEP 8?

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.

17. What is Object? List Oop concepts.

An object is an instance of a class, created by calling the class like a function.

OOP (object-oriented programming) concepts in Python include Class, Object, Method,


Inheritance, Polymorphism, Data Abstraction, and Encapsulation.

18. Is python fully Object- Oriented?

Yes, Python is a fully object-oriented programming language. It supports all the major
features of object-oriented programming (OOP).

19. Which one of the following statements is not valid?

xyz = 1,000,000

x y z = 1000 2000 3000

x,y,z = 1000, 2000, 3000

x_y_z = 1,000,000

The statement that is not valid is:

x y z = 1000 2000 3000

The variable names cannot have spaces, so `x y z` is not a valid variable name. The
other statements are valid Python variable assignments.

20. What does polymorphism refer to in Python?

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

You might also like