Search Header Logo

Programming2-Q2-Assessment

Authored by Julio Fuentes

Computers

12th Grade

Used 3+ times

Programming2-Q2-Assessment
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

21 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following is a valid variable name in Python?

a. 2var_name
b. my_variable
c. variable name

d. global - variable

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What is the correct way to declare a string variable in Python?

a. string name = "Hello"
b. str_name = "Hello"
c. "Hello" = str_name
d. name = Hello

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

In Python, what list method is used to get the length of a list?

a. size()
b. length()
c. len()
d. count()

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

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

a. list[0]
b. list[first]
c. list(1)
d. list.first()

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What method is used to add an element to the end of a list in Python?

a. append()
b. insert()
c. add()
d. extend()

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What is the result of the following code: my_str = "1, 2, 3," + "4, 5"?

a. "1, 2, 3, 4, 5"
b. [[1, 2, 3], [4, 5]]
c. "1, 2, 3, "4, 5"
d. Error

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

How do you remove the last element in a list in Python?

a. list.remove(value)
b. list.pop()
c. list.delete(element)
d. list.exclude(element)

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?