# (Week 1) NPTEL Python for Data Science Assignment 1 Answers 2022

NPTEL Python For Data Science Assignment 1 Answers 2023 (week1) :- Hello students in this article we are going to share Answers of Python For Data Science Assignment 1 Answers 2023. All the Answers are provided below to help the students as a reference, You must submit your assignment with your own knowledge.

## NPTEL Python For Data Science Assignment 1 Answers 2023

1. Which of the following is/are the correct ways of naming variables in Python?

a. 2_max = 5
b. max_2 = 5
c. max2 = 5
d. max @2 = 5

`Answer:- B, C`

2. What does 5%11 will evaluate to

a. 1
b. 5
c. 0
d. Syntax error

`Answer:- B`

3. What does 4//7 evaluate to

a. 0
b. 1
c. 0.0
d. 4

`Answer:- A`

4.What will be the output of the following code snippet?
num_1= ‘100
num_2 = ‘200
print(num_1 + num_2)

A. 300
B. 100200
C. ‘100’ + ‘200’
D. ‘100 + 200’

`Answer:- B`

5.What will be the output of the following code snippet?

num_1= ‘100
num_2 = ‘200
print(num_1 + num_2)

num_1 = int (num_1)
num_2 = int (num_2)
print(num_1 + num_2)

A. 300
B. 100200
C. ‘100’ + ‘200’
D. ‘100 + 200’

`Answer:- A`

6. What is the type of the following expression? 1 + 4 / 2

A. int
B. float
C. bool
D. str

`Answer:- B`

7. What is the type of the following expression? A. str
B. bool
C. True
D. False

`Answer:- C`

8. What is the output of the following code snippet? A. 32
B. 44
C. 40
D. 36

`Answer:- C`

9. Which of the arithmetic operators given below cannot be used with ‘strings’ in Python?

A. *
B. –
C. +
D. All of the above

`Answer:- B`

10. Consider the list of instructions and resulting outputs given below. Pick the set that is incorrect. A. 4
B. 2
C. 1, 3
D. 1, 3, 4
E. All are correct

`Answer:- B`

11. Two variables Xand Y were assigned the following values initially: X = 3 and Y = 6. Which of the following statements will help swap the values between these two variables?

A. Y = X
X = Y
B. X = Y
C. X = Y
Y = X
D. X, Y = Y, X

`Answer:- D`

## NPTEL Python for Data Science Assignment 1 Answers 2022 [July-Dec]

Q1. What is the output of the following code?

``````num1 = 12
num2 "58"
print(num1 + num2)``````
• 12
• 58
• 70
• Error: Invalid operation, unsupported operator ‘+’ used between ‘int’ and ‘str’
`Answer:- d`

2. 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?

a. int, int
b. float, float
c. float, int
d. int, float

`Answer:- b`

3. Let a = 5 (101 in binary) and b = 3 (011 in binary). Which of the following operations results in the values 7 and 1?

`Answer:- b`

4. State whether the given statement is True or False.

When using the floor division operator (//), if the result is negative, then the result is rounded off to the next largest integer.

a. True
b. False

`Answer:- b`

5. Let x = “50”. Which of the following commands converts the ‘x to float datatype?

a. str(float,x)
b. x.float()
c. float(x)
d. Cannot convert a string to float datatype

`Answer:- c`

6. Which of the following variable names are INVALID in Python?

a. 1_variable
b. variable_1
c. variable_*
d. variable1

`Answer:- a, c`

7. Which of the following variable assignments would throw an error?

a. var1=True; var2=False;
b. var1=false; var2=true;
c. var1=’True’; var2=’False’;
d. var1=’true’; var2=’false’;

`Answer:- b`

8. Predict the output of the following code

``````x=4
y-11
p 5.0
ans x**(y % p)
print(ans)``````

a. 4
b. 4.0
c. 5
d. 4.1

`Answer:- b`

9. The value of the variable result after running the code snippet below is ____

``````num-20.5
z-3
result-2+:*3+num/lz
print(result)``````
• a. 89.0
• b. 17.0
• c. 737.0
• d. 96.0
`Answer:- b`

10. Which Python library is commonly used for data wrangling and manipulation?

a. Numpy
b. Pandas
c. scikit
d. Math

`Answer:- b`

## About Python For Data Science

The course aims at equipping participants to be able to use python programming for solving data science problems.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of average of best 3 assignments out of the total 4 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

## NPTEL Python for Data Science Assignment 1 Answers 2022 [Jan-June]

Q1. Which of the arithmetic operators given below cannot be used with ‘strings’ in Python?

(A) ∗
(B) −
(C) +
(D) All of the above

Q2. When the following statement is executed, what type of error is obtained? (A) Type Error

(B) Syntax Error

(C) Value Error

(D) None of the above

Q3. Two variables X and Y were assigned the following values initially. X = 3 and Y = 6. Which of the following statements will help swap the values between these two variables?

(A) Y = X
X = Y

(B) X = Y

(C) X = Y
Y = X

(D) X, Y = Y, X

Answer:- (D) X, Y = Y, X

Q4. From the following set of statements, what will be the value of variable y in the final print statement? (A) 8
(B) 9
(C) 1
(D) Error
(E) 16

Q5. Consider j = 5 and k = 11. We change the values from j = 7 and k remains constant.

What is print(j|k) before and after modification of value in variable j?

(A) 3,15
(B) 15,15
(C)11,15
(D) 15,7
(E) None of the above

Q6. What would be the output of the following statements? (A) False
(B) True
(C) Not True
(D) None of the above

Q7. What does k = 4%7 evaluate to and what is the type of variable k?

(A) 4,int
(B) 0.0,float
(C) 0,int
(D) 1,int
(E) None of the above

Q8. j = 6 and g = 3.3. If normal division and floor division was done between j and k, what would be the type of the resultant variable?

(A) int,int
(B) float,float
(C) float,int
(D) int,float
(E) None of the above

Q9. Consider two answers to a question; answer1 and answer2. What is the output of the following set of statements? (A) True
(B) False
(C) 0
(D) 1

Q10. Consider the list of instructions and resulting outputs given below. Pick the set that is incorrect. (A) 4
(B) 2
(C) 1,3,4
(D) 3,4
(E) All are correct

NPTEL The Joy of Computing using Python Assignment 1 Answers

NPTEL English Literature for competitive exams Assignment 1 Answers

NPTEL Data Analytics with Python Assignment 1 Answers 2022

NPTEL Introduction To Internet Of Things Assignment 1 Answers

NPTEL Cloud Computing Week 1 Assignment Answers 2022

NPTEL Python for Data Science Assignment 1 Answers 2022:- All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

Disclaimer:- We do not claim 100% surety of solutions, these solutions are based on our sole expertise, and by using posting these answers we are simply looking to help students as a reference, so we urge do your assignment on your own.