0% found this document useful (0 votes)
5 views1 page

Python Test 10

The document contains a quiz with multiple-choice questions related to Python programming and its libraries. Questions cover topics such as ODE integration, list manipulation, plotting, and function definitions. Each question is designed to test the understanding of Python syntax and functionality.

Uploaded by

Chethan Beelagi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Python Test 10

The document contains a quiz with multiple-choice questions related to Python programming and its libraries. Questions cover topics such as ODE integration, list manipulation, plotting, and function definitions. Each question is designed to test the understanding of Python syntax and functionality.

Uploaded by

Chethan Beelagi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ST-OTC   C.

Python Test
Ho… / My cou… / PYTPOS… / Gen… / Python …

Back

Time left 0:14:56

Question 1

Not yet answered

Marked out of 1.00

Flag question

The following function is used to integrate a


system of ODEs.

Select one:
a. odeint

b. None of the Above

c. odepack

d. quad

Clear my choice

Question 2

Not yet answered

Marked out of 1.00

Flag question

Predict the output of the


following code:

a = ['Mary', 'had', 'a', 'little', 'la

for i in range(len(a)): ... print i,

1 Mary
0 had
Choose...
2 lamb

0 Mary
1 had
2 a
Choose...
3 little
4 lamb

4 Mary
3 had
2 little Choose...
1 lamb

4 lamb
3 l
Choose...
1 Mary

Mary,had,a,little,lamb
Choose...

Question 3

Not yet answered

Marked out of 1.00

Flag question

Which of the following creates 100 equally


spaced points between -pi/2 and pi/2?

Select one:
a. linspace(-pi/2, 100, pi/2)

b. linespace(pi/2, 100, -pi/2)

c. linspace(-pi/2, pi/2, 100)

d. linespace(-pi/2, pi/2, 100)

Clear my choice

Question 4

Not yet answered

Marked out of 1.00

Flag question

I write 4/3 on first line, 4-3*5 on second line


and 3+(4-6)*5 on third line, and now what will
be the output when I click evaluate in sage
notebook?

Select one:
-7

1.333
-11
-7

1
-11
-7

1.3333

Clear my choice

Question 5

Not yet answered

Marked out of 1.00

Flag question

What should be the syntax if we want to flip


coordinates of bar plot (variables on y and
values in x )?

Select one:
bary()

bar(coord_flip = True)

barh()

bar(flip = True)

Clear my choice

Question 6

Not yet answered

Marked out of 1.00

Flag question

What is the output of following?


print(“abcabcab”.split(‘c’, 0))

Select one:
Error

[‘abcabcab’]

None of them

‘abcabcab’

Clear my choice

Question 7

Not yet answered

Marked out of 1.00

Flag question

What is the output of the expression, 7*1**7 ?

Select one:
1

343

49

Clear my choice

Question 8

Not yet answered

Marked out of 1.00

Flag question

What is the output of following?

list = [1,2,3,4,5,6,7,8,9,10]
l = mean(list[1::2])
print(l)

Select one:
6

6.0

5.0

Clear my choice

Question 9

Not yet answered

Marked out of 1.00

Flag question

Whih command is used to clear the plot?

Select one:
closefig()

clf()

clr()

clear()

Clear my choice

Question 10

Not yet answered

Marked out of 1.00

Flag question

Which method can be used to find out the


roots of any arbitrary function?

Select one:
a. func()

b. fsolve()

c. roots()

d. arb()

Clear my choice

Question 11

Not yet answered

Marked out of 1.00

Flag question

What will the following function do?


def what(x) return x*x ?

Select one:
a. Function doesn't have docstring

b. Returns x

c. Returns the square of x

d. Error

Clear my choice

Question 12

Not yet answered

Marked out of 1.00

Flag question

The function ``lstsq`` returns the least-


squares solution to an equation?

Select one:
True

False

Question 13

Not yet answered

Marked out of 1.00

Flag question

What happens when the following code is


executed:: xlabel("First label") xlabel("Second
label")

Select one:
a. The label of x-axis is set to “First label
Second label”

b. The label of x-axis is “First label” and


the label of y-axis is “Second label”

c. The label of x-axis is set to “First


label”

d. The label of x-axis is set to “Second


label”

Question 14

Not yet answered

Marked out of 1.00

Flag question

What does ones_like() function do?

Select one:
Return an array of ones with the same
shape as a given array

Return an array of ones with the same


type as a given array

None of them

Return an array of ones with the same


shape and type as a given array

Question 15

Not yet answered

Marked out of 1.00

Flag question

Given the list primes, ``primes = [2, 3, 5, 7, 11,


13, 17, 19, 23,29]``, How do you obtain the
primes 2 and 13?

Select one:
a. primes[::5]

b. primes[::13]

c. primes[::4]

d. primes[::6]

Question 16

Not yet answered

Marked out of 1.00

Flag question

How do you obtain the real and imaginary parts


of a complex number ‘’p’’ as separate?

Select one:
a. real(p) , imag(p)

b. p.real(0),p.imag(0)

c. p.real , p.imag

d. p.real( ) , p.imag( )

Question 17

Not yet answered

Marked out of 1.00

Flag question

How do you set the title as x^2-5x+6 in LaTeX


style formatting?

Select one:
a. title(“#x^2-5x+6#”)

b. title(“$x^2-5x+6$”)

c. title(“x^2-5x+6”)

d. title(“x**2-5*x+6”)

Question 18

Not yet answered

Marked out of 1.00

Flag question

If ``a = [1, 1, 2, 3, 3, 6,6,4]``. What is set(a)

Select one:
a. Error

b. set([1, 1, 2, 3, 3, 6,6,4])

c. set([1, 2, 3, 3, 6,6])

d. set([1, 2, 3, 6, 4])

Question 19

Not yet answered

Marked out of 1.00

Flag question

If ``a = [1, 1, 2, 3, 3, 5, 5, 8]``


What is set(a)?

Select one:
a. set([1, 1, 2, 3, 3, 5, 5, 8])

b. set([1, 2, 3, 3, 5, 5])

c. set([1, 2, 3, 5, 8])

d. Error

Question 20

Not yet answered

Marked out of 1.00

Flag question

Generate the correct program code


sequence from the given jumbled
code bits. you have to select the
correct sequence number options
to complete the program.

print “postive”; Choose...

print “zero”; Choose...

Elif A < 0
Choose...

A = -3; Choose...

if A> 0 Choose...

else Choose...

print “negative”; Choose...

Finish attempt ...

Quiz navigation

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18

19 20

Finish attempt ...

You are logged in as CHETHAN BEELAGI . (Log out)


PYTPOST001

Data retention summary


Get the mobile app
Switch to the standard theme

You might also like