Python Workshop Quiz

Python Workshop Quiz

1st Grade

15 Qs

quiz-placeholder

Similar activities

Managing Daily Activities

Managing Daily Activities

1st - 5th Grade

15 Qs

Apply for a job

Apply for a job

1st - 5th Grade

10 Qs

Malaysian Halal Laws

Malaysian Halal Laws

1st Grade

11 Qs

Tavi quiz

Tavi quiz

1st - 5th Grade

15 Qs

all about me (kara)

all about me (kara)

1st - 5th Grade

13 Qs

Business report

Business report

1st - 3rd Grade

10 Qs

CASH FLOW

CASH FLOW

1st Grade

12 Qs

Management Chapter 4

Management Chapter 4

1st - 3rd Grade

10 Qs

Python Workshop Quiz

Python Workshop Quiz

Assessment

Quiz

Business

1st Grade

Hard

Created by

CS_116_SURYANSH SINGH

Used 4+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which keyword is used to declare a variable in Python?

var

declare

define

none of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the output of the following code snippet?

  2. my_tuple = ("apple", "banana", "cherry")

    print(my_tuple[1])

"banana"

"apple"

"cherry"

TypeError:

'tuple' object has no attribute '1'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following is NOT a valid data type in Python?

  1. int

  1. float

  1. string

  1. character

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the output of the following code snippet?

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

print(my_list[1:3])

[1, 2]


[2, 3]

[3, 4]

[1, 2, 3]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. How do you check the number of elements in a set in Python?

  1. elements(my_set)

  1. len(my_set)

  1. count(my_set)

  1. size(my_set)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What does the append() method do in Python?

  1. Removes an element from a list

  1. Adds an element to the start of a list

  1. Adds an element to the end of a list

Reverses the order of elements in a list

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. How do you remove an item from a list in Python?

  1. discard(item)

  1. delete(item)

  1. pop(item)

remove(item)

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?