Skip to main content

Coding Quiz 03

Mejbah Ahammad

Python Coding Quiz

Python Coding Quiz

Answer the coding questions below by selecting all applicable options:

Time Remaining: 10:00

1. Which syntax is correct for defining a function in Python?

2. Which of the following is the correct way to create a list in Python?

3. Which of the following statements will correctly access the last element of a list called my_list? (Select all that apply)

4. Which of the following syntax will create a dictionary in Python?

5. How would you iterate over each item in a list called items in Python?

6. Which of the following code will create a set in Python?

7. How can you concatenate two strings "Hello" and "World" in Python?

8. How do you slice a list my_list to get elements from index 1 to 3 (inclusive of 1, exclusive of 3)?

9. How do you start an if statement in Python?

10. Which keyword is used to define a class in Python?