Data Analytics Using Python
* Indicates required question
Email *
Record [email protected] as the email to be included with my response
Which is the most appropriate definition for recursion? * 1 point
A function that calls itself
A function execution instance that calls another execution instance of the same
function
A class method that calls another class method
An in-built method that is automatically called
Which of the following statements is used to create an empty set in * 1 point
Python?
()
[]
{}
set()
What will be the output of the following Python code? * 1 point
>>> s={5,6}
>>> s*3
Error as unsupported operand type for set data type
{5,6,5,6,5,6}
{5,6}
Error as multiplication creates duplicate elements which isn’t allowed
Which type of Programming does Python support? * 1 point
object-oriented programming
structured programming
functional programming
all of the mentioned
Which of the following is the best machine learning method? * 1 point
scalable
accuracy
fast
all of the above
What will be the output of the following Python code? * 1 point
x,y = 12,14
if(x+y==26):
print("true")
else:
print("false")
true
false
What will be the output of the following Python function? * 1 point
len(["hello",2, 4, 6])
error
What will be the output of the following Python code? * 1 point
nums = set([1,1,2,3,3,3,4,4])
print(len(nums))
Error, invalid syntax for formation of set
8
Which of the following is an invalid variable? * 1 point
my_string_1
1st_string
foo
What will be the output of this code? * 1 point
import math
abs(math.sqrt(36))
Error
-6
6.0
What will be output of following code? * 1 point
import numpy as np array1=np.array([100,200,300,400,500,600,700])
print(array1[1:5:2])
[200 300]
[200 700]
[200 400]
(200,400)
Amongst which of the following is / are used to analyze the data in * 1 point
pandas.
Dataframe
Series
Both A and B
None of the mentioned above
What will be the output of the following Python code? * 1 point
def f(values):
values[0] = 44
v = [1, 2, 3]
f(v)
print(v)
[1, 44]
[1, 2, 3, 44]
[44, 2, 3]
[1, 2, 3]
* 1 point
What will be correct syntax for pandas series?
pandas.Series( data, index, dtype)
pandas_Series( data, index, dtype)
pandas_Series( data, index, dtype, copy)
pandas.Series( data, index, dtype, copy)
What is machine learning? * 1 point
A type of computer
A technique for teaching computers to learn from data
A programming language
A hardware device
What will be the output of the following Python code? * 1 point
x = 'abcd'
for i in x:
print(i.upper())
abcd
ABCD
aBCD
error
Which of the following statement for creating dataframe is valid? * 1 point
df = pd.DataFrame(dict1)
df = pd.Dataframe(dict1)
df = pd.dataFrame(dict1)
df = pd.dataframe(dict1)
What will be the output of the following Python code? * 1 point
x = 'abcd'
for i in range(len(x)):
print(i)
erro
1234
abcd
0,1,2,3
Enter Your Email Address *
[email protected]
Which of the following is correct output of this program? * 1 point
x = ['xy', 'yz']
for i in x:
i.upper()
print(x)
['xy', 'yz']
['XY', 'YZ']
[None, None]
None of these
What will be the output of the following Python code? * 1 point
d = {"john":40, "peter":45}
print(d["john"])
40
45
“john”
“peter”
Suppose t = (1, 2, 4, 3), which of the following is incorrect? * 1 point
print(t[3])
t[3] = 45
print(max(t))
print(len(t))
Which of the following Python statements will result in the output: 6? * 1 point
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
A[2][1]
A[1][2]
A[3][2]
A[2][3]
What will be the output of the following Python code? * 1 point
>>>str1="helloworld"
>>>str1[::-1]
dlrowolleh
hello
world
helloworld
Which of the following declarations is incorrect in python language? * 1 point
xyzp = 5,000,000
x y z p = 5000 6000 7000 8000
x,y,z,p = 5000, 6000, 7000, 8000
x_y_z_p = 5,000,000
What arithmetic operators cannot be used with strings in Python? * 1 point
All of the mentioned
What will be the value of the following Python expression? * 1 point
4+3%5
What will be the output of the following Python code? * 1 point
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)
[‘ab’, ‘cd’]
[‘AB’, ‘CD’]
[None, None]
none of the mentioned
What will be the output of following code? * 1 point
import pandas as pnd
pnd.Series([1,2], index= ['a','b','c'])
Syntax Error
Index Error
Value Error
None of the above mentioned
What will be the output of the following Python function? * 1 point
min(max(False,-3,-4), 2,7)
-4
-3
False
What will be the output of the following Python code? * 1 point
def f1():
x=15
print(x)
x=12
f1()
Error
12
15
1512
What is the output of the following program : * 1 point
def myfunc(a):
a=a+2
a=a*2
return a
print myfunc(2)
16
Indentation Error
Runtime Error
What will be the output of the following Python code? * 1 point
>>>"Welcome to Python".split()
[“Welcome”, “to”, “Python”]
(“Welcome”, “to”, “Python”)
{“Welcome”, “to”, “Python”}
“Welcome”, “to”, “Python”
What will be the output of the following Python statement? * 1 point
>>>"a"+"bc"
abc
a+bc
bc
How do you plot a simple line graph using Matplotlib in Python? * 1 point
plot(x_values, y_values)
lineplot(x_values, y_values)
draw_line(x_values, y_values)
create_line_graph(x_values, y_values)
What does Matplotlib provide in Python? * 1 point
Data manipulation
Data visualization
Machine learning
Text processing
What will be the output of the following Python code? * 1 point
a={1:"A",2:"B",3:"C"}
b={4:"D",5:"E"}
a.update(b)
print(a)
{1: ‘A’, 2: ‘B’, 3: ‘C’}
Method update() doesn’t exist for dictionaries
{1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}
{4: ‘D’, 5: ‘E’}
What will be the output of the following Python expression? * 1 point
round(4.576)
4.5
4.6
Amongst which of the following is a function which does not have any * 1 point
name?
Del function
Show function
Lambda function
None of the mentioned above
What will be the output of this program? * 1 point
print(6 + 5 - 4 * 3 / 2 % 1)
7.0
15
11.0
What will be the output of the following Python code? * 1 point
>>>t = (1, 2)
>>>2 * t
(1, 2, 1, 2)
[1, 2, 1, 2]
(1, 1, 2, 2)
[1, 1, 2, 2]
What will be the output of the following Python code? * 1 point
>>> a={1,2,3}
>>> b=a
>>> b.remove(3)
>>> a
{1,2,3}
Error, copying of sets isn’t allowed
{1,2}
Error, invalid syntax for remove
During the execution of following code, what will be the response, we get - * 1 point
import pandas as pd
s =pd.Series([1,2,3,4,5],index= ['a','b','c','d','e'])
print(s['f'])
KeyError
IndexError
ValueError
None of the above mentioned
What will be output for the following code? * 1 point
import pandas as pd s = pd.Series([1,2,3,4,5],index = ['a','b','c','d','e'])
print s['a']
What will be the output of the following Python code? * 1 point
a={1:"A",2:"B",3:"C"}
for i in a:
print(i,end=" ")
123
‘A’ ‘B’ ‘C’
1 ‘A’ 2 ‘B’ 3 ‘C’
Error, it should be: for i in a.items():
list, tuple, and range are the ___ of Data Types. * 1 point
Sequence Types
Binary Types
Boolean Types
None of the mentioned above
What will be the output of the following Python function? * 1 point
import math
print(abs(math.sqrt(25)))
Error
-5
5.0
Which of the following operators is the correct option for power(ab)? * 1 point
a^b
a**b
a^^b
a^*b
Which function from the options given below can read the dataset from a * 1 point
large text file?
read_hdf
read_json
read_pickle
read_csv
What do we use to define a block of code in Python language? * 1 point
Key
Brackets
Indentation
None of these
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after * 1 point
listExample.pop(1)?
[3, 4, 5, 20, 5, 25, 1, 3]
[1, 3, 3, 4, 5, 5, 20, 25]
[3, 5, 20, 5, 25, 1, 3]
[1, 3, 4, 5, 20, 5, 25]
Submit Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy
Forms