NPTEL! Python For Data Science Week 1 Answer 2024

Please Refer here to See the Detailed Explanation YOUTUBE EXPLANATION VIDEO


Week 1 : Assignment 1

Due date: 2024-02-07, 23:59 IST.
Your last recorded submission was on 2024-01-13, 07:51 IST
1 point
What is the output of the following code?


 
 
 
 
1 point
What is the output of the following code?


 
 
 
 
ANSWER : -2
1 point
Consider a following code snippet. What is a data type of ?


 
 
 
 
1 point
Which of the following variable names are INVALID in Python?
 
 
 
 
1 point
While naming the variable, use of any special character other than underscore(_) will throw which type of error?
 
 
 
 
1 point
Let x = “Mayur”. Which of the following commands converts the ‘x’ to float datatype?
 
 
 
 
1 point
Which Python library is commonly used for data wrangling and manipulation?
 
 
 
 
ANSWER : Pandas
1 point
Predict the output of the following code.


 
 
 
 
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?
 
 
 
 
ANSWER : float, float
1 point
Let a = 5 (101 in binary) and b = 3 (011 in binary). What is the result of the following operation?


 
 
 
 

<code>

print("=============== Answer 1 ===============")

a = 3
b = "12"
print(type(a*12))
print(a*12)

print("=============== Answer 2 ===============")
a = -9//7
print(a)

print("=============== Answer 3 ===============")
x = 15
y = str(float(x))
print(type(y))

print("=============== Answer 4 ===============")
variable_ = 1
# variable# = 3
# 1_variable = 1
variable_1 = 2

print("=============== Answer 5 ===============")
# variable@ = 3

print("=============== Answer 6 ===============")
x = "Mayur"
# float(x)

print("=============== Answer 8 ===============")
x = 10
y = 5
z = 3
ans = x + y % z
print(ans)


print("=============== Answer 9 ===============")
j = 6
g = 3.3
print(type(j//g))
print(type(j/g))

print("=============== Answer 10 ===============")
a = 5
b = 3

print(a & b)

</code>

Comments

Popular Posts