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

Python for Data Science PART 2

The document contains a series of important questions and answers related to Python for Data Science, covering topics such as data manipulation, libraries, and basic programming concepts. Key questions include the definition of Python, commonly used libraries like NumPy and Matplotlib, and fundamental functions and methods in Python. The document serves as a study guide for learners at IIT Kharagpur.

Uploaded by

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

Python for Data Science PART 2

The document contains a series of important questions and answers related to Python for Data Science, covering topics such as data manipulation, libraries, and basic programming concepts. Key questions include the definition of Python, commonly used libraries like NumPy and Matplotlib, and fundamental functions and methods in Python. The document serves as a study guide for learners at IIT Kharagpur.

Uploaded by

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

Python for Data Science IIT Kharagpur

Python For Data Science

IMP QUESTIONS PART 2

Question 1:
What is Python?
A) A type of snake

AM
B) A high-level programming language
C) A mathematical formula
D) A computer hardware

AY
Accepted Answer: B) A high-level programming language

Question 2:
SW
Which of the following libraries is commonly used for data manipulation and
analysis in Python?
A) TensorFlow
B) PyTorch
C) NumPy
D) Django
Y
M

Accepted Answer: C) NumPy


@

Question 3:
What does the pandas library provide in Python for data science?
A) Data visualization tools
B) Machine learning algorithms
C) Data structures and data analysis tools
D) Web development capabilities

Accepted Answer: C) Data structures and data analysis tools

Page 1 MY SWAYAM
Python for Data Science IIT Kharagpur

Question 4:
Which of the following data types is not supported by Python?
A) Integer
B) Float
C) Complex
D) Character

Accepted Answer: D) Character

AM
Question 5:
What does the 'print' function do in Python?
A) Reads input from the user

AY
B) Displays output to the console
C) Performs mathematical operations
D) Declares a variable
SW
Accepted Answer: B) Displays output to the console

Question 6:
What is the correct way to create a list in Python?
Y

A) list = {1, 2, 3}
B) list = [1, 2, 3]
M

C) list = (1, 2, 3)
D) list = "1, 2, 3"
@

Accepted Answer: B) list = [1, 2, 3]

Page 2 MY SWAYAM
Python for Data Science IIT Kharagpur

Question 7:
What is the purpose of the 'for' loop in Python?
A) To define a function
B) To iterate over a sequence (list, tuple, string, etc.)
C) To make a decision
D) To perform exception handling

Accepted Answer: B) To iterate over a sequence (list, tuple, string, etc.)

AM
Question 8:
Which operator is used for exponentiation in Python?
A) ^
B)
C) /
D) %
AY
SW
Accepted Answer: B) (Double Asterisk)

Question 9:
What is the output of the following code snippet?
Y

```python
print("Hello, " + "World!")
M

```
A) Hello, World!
@

B) Hello, + World!
C) Hello, , World!
D) Hello World!

Accepted Answer: A) Hello, World!

Page 3 MY SWAYAM
Python for Data Science IIT Kharagpur

Question 10:
Which of the following is a valid way to comment in Python?
A) // This is a comment
B) /* This is a comment */
C) # This is a comment
D) -- This is a comment

Accepted Answer: C) # This is a comment

AM
Question 11:
What does the 'len()' function do in Python?
A) Returns the largest element in a list

AY
B) Returns the length of a sequence (list, tuple, string, etc.)
C) Checks if a variable is defined
D) Converts a string to lowercase
SW
Accepted Answer: B) Returns the length of a sequence (list, tuple, string, etc.)

Question 12:
What is the purpose of the 'if' statement in Python?
Y

A) To define a loop
B) To perform a specific action when a condition is true
M

C) To print output to the console


D) To create a function
@

Accepted Answer: B) To perform a specific action when a condition is true

Page 4 MY SWAYAM
Python for Data Science IIT Kharagpur

Question 13:
What is the correct way to define a function in Python?
A) function myFunction():
B) def myFunction():
C) define myFunction():
D) func myFunction():

Accepted Answer: B) def myFunction():

AM
Question 14:
Which library is commonly used for data visualization in Python?
A) NumPy
B) Matplotlib
C) Pandas
D) Scikit-Learn
AY
SW
Accepted Answer: B) Matplotlib

Question 15:
What is the purpose of the 'import' keyword in Python?
Y

A) To print output to the console


B) To define a variable
M

C) To include external libraries or modules


D) To create a loop
@

Accepted Answer: C) To include external libraries or modules

Page 5 MY SWAYAM
Python for Data Science IIT Kharagpur

Question 16:
What does the 'strip()' method do for strings in Python?
A) Removes whitespace characters from the beginning and end of a string
B) Converts the string to uppercase
C) Reverses the string
D) Counts the number of occurrences of a substring

Accepted Answer: A) Removes whitespace characters from the beginning and


end of a string

AM
Question 17:
What does the 'append()' method do for lists in Python?
A) Sorts the list in ascending order

AY
B) Adds an element to the end of the list
C) Removes the last element from the list
D) Reverses the order of elements in the list
SW

Accepted Answer: B) Adds an element to the end of the list


Y

Subscribe for
M

PART 3 AND 4
@

MY SWAYAM

PDF OF ALL ABOVE QUESTIONS IS AVAILABLE IN THE


DESCRIPTION BOX OF THIS VIDEO.

WANT TO PART 2, COMMENT BELOW AND SUBSCRIBE THIS


YOUTUBE CHANNEL “MY SWAYAM”

Page 6 MY SWAYAM
Python for Data Science IIT Kharagpur

HAPPY LEARNING
THANK YOU.

AM
AY
SW
Y
M
@

Page 7 MY SWAYAM

You might also like