Search Header Logo

Python Programming Challenge

Authored by Rishi Paul

Computers

12th Grade

Used 3+ times

Python Programming Challenge
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the following code?
x = 5 y = 10
x, y = y, x
print(x, y)

10 10

10 5

5 5

5 10

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the result of 2 ** 3 ** 2?

8

64

512

256

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What does 'Python'.find('o') return?

-2

5

2

4

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will the following code output?

for i in range(5, 1, -1):

print(i, end=' ')

a) 5 4 3 2

5 4 3 2 1 0

4 3 2 1

5 4 3

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the

def foo(a, b, c=10):

return a + b + c

print(foo(3, 4))

14

6

17

20

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which module is best for finding all possible pairs of elements from a list?

permutations

filter

itertools

random

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What error will the following line of code raise: pass = 1 + (-2)**(0.5)?

1. ValueError: math domain error

NameError: name 'pass' is not defined

AttributeError: 'int' object has no attribute 'pass'

IndexError: list index out of range

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?