NPTEL Python for Data Science Week 1 Assignment Answer

ABOUT THE COURSE :
The course aims at equipping participants to be able to use python programming for solving data science problems.
INTENDED AUDIENCE : Final Year Undergraduates

PRE-REQUISITES
: Knowledge of basic data science algorithms

NPTEL Python for Data Science Week 1 Assignment Answer

Course layout

Week 1:
BASICS OF PYTHON SPYDER (TOOL)

• Introduction Spyder
• Setting working Directory
• Creating and saving a script file
• File execution, clearing console, removing variables from environment, clearing environment
• Commenting script files
• Variable creation
• Arithmetic and logical operators
• Data types and associated operations

Week 2:

Sequence data types and associated operations
•        Strings
•        Lists
•        Arrays
•        Tuples
•        Dictionary
•        Sets
•        Range

NumPy
•        ndArray

Week 3:
Pandas dataframe and dataframe related operations on Toyota Corolla dataset
  1. Reading files
  2. Exploratory data analysis
  3. Data preparation and preprocessing
Data visualization on Toyoto Corolla dataset using matplotlib and seaborn libraries
  1. Scatter plot
  2. Line plot
  3. Bar plot
  4. Histogram
  5. Box plot
  6. Pair plot
Control structures using Toyota Corolla dataset
  1. if-else family
  2. for loop
  3. for loop with if break
  4. while loop
  5. Functions
Week 4: CASE STUDY
Regression
  1. Predicting price of pre-owned cars
Classification
  1. Classifying personal income

NPTEL Python for Data Science Week 1 Assignment Answer

Week 1 : Assignment 1

Due date: 2025-02-05, 23:59 IST.
Assignment not submitted

1 point
Which of the following variable names are INVALID in Python?

  • 1_variable
  • variable_1
  • variable1
  • variable#

1 point
Which of the following operators have lower precedence than “not” in Python?

  • +
  • and
  • ==
  • |

1 point
What will be the output of the following code?

a = 10  
b = 5  
print(a ** b % 3)  
  • 0
  • 100
  • 1
  • 2

1 point
What will be the output of the following code snippet?

greetings = "Namaste"  
greetings_1 = float(greetings)  
print(type(greetings_1))  
  • int
  • float
  • str
  • Code will throw an error.

1 point
Given two variables, j = 6 and g = 3.3. If both normal division and floor division operators were used to divide j by g, what would be the data type of the value obtained from the operations?

  • int, int
  • float, int
  • float, float
  • int, float

1 point
What will be the output of the following code snippet?

a = "10"  
b = float(a) + 5  
result = str(b) + "123"  
print(type(result))  
  • <class 'float'>
  • <class 'str'>
  • <class 'int'>
  • The code will give an error.

1 point
What will be the output of the following code snippet?

a = 15  
b = 3  
c = 4  
result = a + b * c // (c % b) - 5  
print(result)  
  • 20
  • 1
  • 22
  • 0

1 point
What is the output of the following code snippet?

a = 4  
b = 5  
a *= b * 2  
print(a)  
  • 10
  • 20
  • 25
  • 40

1 point
What is the output of the following code snippet?

a = 3  
b = 5  
c = (a == 3) and (b == 5) or (a != 3)  
print(c)  
  • True
  • False
  • Error

1 point
Let a = 5 (101 in binary) and b = 3 (011 in binary). What is the result of the following operation?

a = 5  
b = 3  
print(a & b)  
  • 3
  • 7
  • 5
  • 1

Related Posts

Leave a Reply