Search Header Logo

PP FINAL V2

Authored by Динара Альменбетова

Special Education

University

Used 1+ times

PP FINAL V2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What arithmetic operators cannot be used with strings ?

A)*

B)+

C)-

D)All of the mentioned

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code snippet ?

d = {"john":40, "peter":45}

"john" in d

a) True

b) False

c) None

d) Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code ?

import random

random.choice([10.4, 56.99, 76])

a) Error

b) Either 10.4, 56.99 or 76

c) Any number other than 10.4, 56.99 and 76

d) 56.99 only

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the function re.search do?

a) matches a pattern at the start of the string

b) matches a pattern at any position in the string

c) such a function does not exist

d) none of the mentioned

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code snippet ?

d = {"john":40, "peter":45}

print(list(d.keys()))

a) ["john", "peter"]

b) ["john": 40, "peter": 45]

c) {"john", "peter"}

d) ("john": 40, "peter": 45)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the ‘return’ keyword do in a function ?

a) Terminates the function

b) Returns a value from the function

c) Skips the function

d) Declares a variable

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet ?

def multiply(a, b=2):

return a * b

result = multiply(5)

print(result)

a) 5

b) 10

c) 2

d) 7

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?