Python for Data Science | Week 1

Session: JULY-DEC 2024

Course name: Python For Data Science

Course Link: Click Here

For answers or latest updates join our telegram channel: Click here to join

These are Python for Data Science Week 1 Assignment 1 Nptel Answers


Q1. What is the output of the following code?
36
121212
123
Error: Invalid operation, unsupported operator ‘*’ used between ‘int’ and ‘str’

Answer: 121212


Q2. What is the output of the following code?
-1
-2
-1.28
1.28

Answer: -2


For answers or latest updates join our telegram channel: Click here to join

These are Python for Data Science Week 1 Assignment 1 Nptel Answers


Q3. Consider a following code snippet. What is a data type of y?
int
float
str
Code will throw an error.

Answer: str


Q4. Which of the following variable names are INVALID in Python?
1_variable
variable_1
variable1
variable#

Answer: [A, D] 1_variable, variable#


For answers or latest updates join our telegram channel: Click here to join

These are Python for Data Science Week 1 Assignment 1 Nptel Answers


Q5. While naming the variable, use of any special character other than underscore(_) ill throw which type of error?
Syntax error
Key error
Value error
Index error

Answer: Syntax error


Q6. Let x = “Mayur”. Which of the following commands converts the ‘x’ to float datatype?
str(float,x)
x.float()
float(x)
Cannot convert a string to float data type

Answer: Cannot convert a string to float data type


For answers or latest updates join our telegram channel: Click here to join

These are Python for Data Science Week 1 Assignment 1 Nptel Answers


Q7. Which Python library is commonly used for data wrangling and manipulation?
Numpy
Pandas
scikit
Math

See also  Python for Data Science NPTEL Week 2 Assignment Answers

Answer: Pandas


Q8. Predict the output of the following code.
12.0
12
11.667
11

Answer: 12


For answers or latest updates join our telegram channel: Click here to join

These are Python for Data Science Week 1 Assignment 1 Nptel Answers


Q9. 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, float
float, int
int, float

Answer: float, float


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

Answer: 1


For answers or latest updates join our telegram channel: Click here to join

These are Python for Data Science Week 1 Assignment 1 Nptel Answers

Python for Data Science NPTEL All weeks: Click Here

More Nptel Courses: https://progiez.com/nptel-assignment-answers


These are Python for Data Science Week 1 Assignment 1 Nptel Answers