Search Header Logo

untitled

Authored by R.SAMPAVI Dept

Education

University

untitled
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code: def my_function(fname, lname): print(lname + " " + fname) my_function("Coco", "Sheth")

Coco Sheth

Sheth Coco

CocoSheth

ShethCoco

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct output for: def my_function(food): for x in food: print(x) fruits = ["apple", "banana", "cherry"] my_function(fruits)

banana apple cherry

apple banana cherry

banana cherry apple

cherry apple banana

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be in the blank space to print the second item: fruits = ["apple", "banana", "cherry"] print(______)

fruits[1]

fruits[3]

fruits[2]

fruits[0]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What do we use to remove banana from the list: lsi = ["apple", "banana", "cherry"]

lsi.delete("banana")

lsi.remove["banana"]

lsi.delete["banana"]

lsi.remove("banana")

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Use the correct syntax to print the number of items in the fruits tuple. fruits = ("apple", "banana", "cherry")

print(length(fruits))

print(len(fruits))

print(len(tuple(fruits)))

print(totallength(fruits))

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Use negative indexing to print the last item in the tuple. fruits = ("apple", "banana", "cherry") print(fruits[___])

0

-1

-2

-3

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can we print the value of the "model" key of the car dictionary. car = { "brand": "Ford", "model": "Mustang", "year": 1964 }

print(car.get["model"])

car.get("model")

print(car.get("model"))

print(car("model"))

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?