Python for Data Science NPTEL Week 1 Assignment Solution | NPTEL Python for Data Science Week 1 Assignment Answer





Note :- Don't Copy Answers Blindly.

NPTEL Python for Data Science Week 1 Assignment Solution

The course is free to enroll and learn from. But if you want a certificate, you have to register and write the proctored exam conducted by us in person at any of the designated exam centres.

The exam is optional for a fee of Rs 1000/- (Rupees one thousand only).

Registration URL: Announcements will be made when the registration form is open for registrations.

The online registration form has to be filled, and the certification exam fee needs to be paid. More details will be made available when the exam registration form is published. If there are any changes, it will be mentioned then. Please check the form for more details on the cities where the exams will be held, the conditions you agree to when you fill the form, etc.

CRITERIA TO GET A CERTIFICATE

Average assignment score: 25% of the average of the best 8 assignments out of the total 12 assignments given in the course.

Exam score: 75% of the proctored certification exam score out of 100.

Final score: Average assignment score + Exam score

Please note that assignments encompass all types (including quizzes, programming tasks, and essay submissions) available in the specific week.

Eligibility for Certificate:

  • You will be eligible for a certificate only if:
    • Average assignment score ≥ 10/25, and
    • Exam score ≥ 30/75.
  • If one of the two criteria is not met, you will not get the certificate even if the final score ≥ 40/100.

The certificate will have your name, photograph, and the score in the final exam with the breakup. It will have the logos of NPTEL and IIT Kharagpur. It will be e-verifiable at nptel.ac.in/noc.

Note: Only the e-certificate will be made available. Hard copies will not be dispatched.

Once again, thanks for your interest in our online courses and certification. Happy learning!

Which of the following variable names are INVALID in Python?

  • A) 1_variable
  • B) variable_1
  • C) variable1
  • D) variable#
The correct answer is A, D.
Explanation: Variable names cannot start with a digit and cannot contain special characters like #.

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

  • A) +
  • B) and
  • C) ==
  • D) |
The correct answer is B.
Explanation: Logical AND has lower precedence than the NOT operator.

What will be the output of the following code?

a = 10
b = 5
print(a ** b % 3)

  • A) 0
  • B) 100
  • C) 1
  • D) 2
The correct answer is C.
Explanation: 10**5 = 100000 and 100000 % 3 = 1.

What will be the output of the following code snippet?

greetings = "Namaste"
greetings_1 = float(greetings)
print(type(greetings_1))

  • A) int
  • B) float
  • C) str
  • D) Code will throw an error.
The correct answer is D.
Explanation: A non-numeric string cannot be converted to float, so a ValueError occurs.

Given two variables, j = 6 and g = 3.3. If both normal division and floor division are used to divide j by g, what will be the data types?

  • A) int, int
  • B) float, float
  • C) float, int
  • D) int, float
The correct answer is B.
Explanation: Both division and floor division with a float operand return float results.

What will be the output of the following code snippet?

a = "10"
b = float(a) + 5
result = str(b) + "123"
print(type(result))

  • A) <class 'float'>
  • B) <class 'str'>
  • C) <class 'int'>
  • D) The code will give an error.
The correct answer is B.
Explanation: The final result is explicitly converted to a string.

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)

  • A) 20
  • B) 1
  • C) 22
  • D) 0
The correct answer is C.
Explanation: Operator precedence results in a final computed value of 22.

What is the output of the following code snippet?

a = 4
b = 5
a *= b * 2
print(a)

  • A) 10
  • B) 20
  • C) 25
  • D) 40
The correct answer is D.
Explanation: b * 2 = 10 and a becomes 4 * 10 = 40.

What is the output of the following code snippet?

a = 3
b = 5
c = (a == 3) and (b == 5) or (a != 3)
print(c)

  • A) True
  • B) False
  • C) Error
The correct answer is A.
Explanation: Both conditions in the AND expression are true, resulting in True.

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)

  • A) 3
  • B) 7
  • C) 5
  • D) 1
The correct answer is D.
Explanation: Bitwise AND of 101 and 011 results in 001, which is 1.

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post