Python Strings and Lists(12 adv Comp. Sci)

Python Strings and Lists(12 adv Comp. Sci)

12th Grade

15 Qs

quiz-placeholder

Similar activities

Strings, Lists & Tuples

Strings, Lists & Tuples

9th - 12th Grade

20 Qs

python quiz

python quiz

12th Grade

20 Qs

Python Fundamentals and Programming

Python Fundamentals and Programming

11th - 12th Grade

13 Qs

Python Unit 6 Sequences Quiz

Python Unit 6 Sequences Quiz

9th - 12th Grade

20 Qs

PCEP 3C: Collect and process data using tuples

PCEP 3C: Collect and process data using tuples

12th Grade

10 Qs

Python lists and tuples

Python lists and tuples

12th Grade

10 Qs

Python Data Types Quiz

Python Data Types Quiz

10th Grade - University

20 Qs

Python End of Topic Quiz

Python End of Topic Quiz

8th Grade - University

15 Qs

Python Strings and Lists(12 adv Comp. Sci)

Python Strings and Lists(12 adv Comp. Sci)

Assessment

Quiz

Computers

12th Grade

Easy

Created by

Imhotep Brooks

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method would you use to convert a string to lowercase in Python?

.lower()

.toLowerCase()

lowercase()

convertToLower()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you concatenate two strings in Python?

Use the '&' operator to join strings.

Call the concat() method on the string object.

Use the '+' operator to concatenate strings.

Use the '*' operator to concatenate strings.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

numbers = [10, 20, 30, 40, 50, 60, 70, 80]

print(numbers[2:6:2])

(Hint: ([start:stop:step])

[30, 40, 50, 60]

[30, 50]

[20, 40, 60]

[10, 30, 50, 70]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you find the length of a string in Python?

Use string.length() to find the length.

Use len(your_string) to get the length of a string.

Use the size() function to get the length.

Count the characters manually in a loop.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

numbers = [1, 2, 3, 4, 5]

print(numbers[::-1])

Hint([start:stop:step])

[1, 2, 3, 4, 5]

[5, 4, 3, 2, 1]

None

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the first element of a list in Python?

my_list[0]

get_first(my_list)

my_list[1]

my_list.first()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method would you use to add an element to the end of a list?

insert()

add()

push()

append()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?