Search Header Logo

LIST, TUPLE AND PYTHON FUNCTION

Authored by rashi bansal

Computers

8th Grade

Used 2+ times

LIST, TUPLE AND PYTHON FUNCTION
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. Choose the correct function declaration of fun1() so that we can execute the following function call successfully :

fun1(25, 75, 55)

fun1(10, 20)

def fun1(**kwargs)

No, it is not possible in Python

def fun1(args*)

def fun1(*data)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What is the output of the following:

aList = [5, 10, 15, 25]

print(aList[::-2])

[15, 10, 5]

[10, 5]

[25, 10]

Error

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

3. What is the type of the following variable :

aTuple = ("Orange")

print(type(aTuple))

list

tuple

int

str

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. What is the output of the following function call :

def fun1(num):

return num + 25


fun1(5)

print(num)

25

5

255

Name error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. What is the output of the following list function?

sampleList = [10, 20, 30, 40, 50]

sampleList.append(60)

print(sampleList)


sampleList.append(60)

print(sampleList)

[10, 20, 30, 40, 50, 60]

[10, 20, 30, 40, 50, 60]

[10, 20, 30, 40, 50, 60]

[10, 20, 30, 40, 50, 60, 60]

Not possible

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Choose the correct way to access value 20 from the following tuple :

aTuple = ("Orange", [10, 20, 30], (5, 15, 25))

aTuple[1:2][1]

aTuple[1:2](1)

aTuple[1:2][1]

aTuple[1][1]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. What is the output of the following code :

def outerFun(a, b):

def innerFun(c, d):

return c + d

return innerFun(a, b)


res = outerFun(5, 10)

print(res)

15

(15,5)

(5,10)

5

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?