(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

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 Week 1 Assignment Answer 2023

1. What is the output of the following code?
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

  • 36
  • 121212
  • 123
  • Error: Invalid operation, unsupported operator β€˜*’ used between β€˜int’ and β€˜str’
Answer :- 121212

2. What is the output of the following code?
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

  • -1
  • -2
  • -1.28
  • 1.28
Answer :-  -2 

3. Consider a following code snippet. What is a data type of y?
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

  • int
  • float
  • str
  • Code will throw an error.
Answer :- Click Here

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

  • 1_variable
  • variable_1
  • variable1
  • variable#
Answer :- Click Here

5. 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 :- Click Here

6. 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 :- Click Here

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

  • Numpy
  • Pandas
  • scikit
  • Math
Answer :-  Click Here

8. Predict the output of the following code.
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

  • 12.0
  • 12
  • 11.667
  • 11
Answer :-  Click Here

9. 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 :-Click Here

10. Let a = 5 (101 in binary) and b = 3 (011 in binary). What is the result of the following operation?
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

  • 3
  • 7
  • 5
  • 1
Answer :-  Click Here
Course NamePython For Data Science
CategoryNPTEL Assignment Answer
Home Click Here
Join Us on TelegramClick Here

NPTEL Python For Data Science Assignment 1 Answers 2023 (January-June)

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

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

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

πŸ‘‡For Week 04 Assignment AnswersπŸ‘‡

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

7. What is the type of the following expression?
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

A. str
B. bool
C. True
D. False

Answer:- C

8. What is the output of the following code snippet?
(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

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.

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023
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

For More NPTEL Answers:- CLICK HERE

Join Our Telegram:- CLICK HERE

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

πŸ‘‡For Week 02 Assignment AnswersπŸ‘‡

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023

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

Answer:- (C) + 

Q2. When the following statement is executed, what type of error is obtained?

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023 

(A) Type Error 

(B) Syntax Error 

(C) Value Error 

(D) None of the above

Answer:- (B) Syntax Error 

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?

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023 

(A) 8 
(B) 9
(C) 1 
(D) Error 
(E) 16

Answer:- (C) 1 

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

Answer:- (B) 15,15 

Q6. What would be the output of the following statements?

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023 

(A) False 
(B) True 
(C) Not True 
(D) None of the above

Answer:- (B) True 

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

Answer:- (A) 4,int 

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

Answer:- (B) float,float 

Q9. Consider two answers to a question; answer1 and answer2. What is the output of the following set of statements?

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023 

(A) True 
(B) False 
(C) 0 
(D) 1

Answer:- For Answer Click here

Q10. Consider the list of instructions and resulting outputs given below. Pick the set that is incorrect.

(Week 1) NPTEL Python for Data Science Assignment 1 Answers 2023 

(A) 4
(B) 2 
(C) 1,3,4 
(D) 3,4 
(E) All are correct

Answer:- For Answer Click here

MORE ANSWERS:-

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.

For More NPTEL Answers:- CLICK HERE

Join Our Telegram:- CLICK HERE