String Lists

1 / 50

What is a nested list?

2 / 50

What is the output of max([1, 10, 5])?

3 / 50

Which operator checks if an item is NOT in a list?

4 / 50

What happens if you try to access L[10] on a list of length 5?

5 / 50

What is the result of [x for x in range(3)]?

6 / 50

How do you copy a list ‘L’ into ‘L2’?

7 / 50

What is the output of 2 in [1, 2, 3]?

8 / 50

How do you clear all elements from list ‘L’?

9 / 50

What is the output of [1, 5, 2].reverse()?

10 / 50

Which function returns a sorted copy of a list without modifying the original?

11 / 50

What is the result of list(‘abc’)?

12 / 50

How do you find the index of ‘blue’ in [‘red’, ‘blue’, ‘green’]?

13 / 50

Are lists in Python mutable?

14 / 50

What is the output of [1, 2, 3][1:2]?

15 / 50

How do you remove a specific value ‘val’ from list ‘L’?

16 / 50

What does L.extend([4, 5]) do to L = [1, 2]?

17 / 50

Which method sorts a list in-place?

18 / 50

What is the result of [1, 2, 3] * 2?

19 / 50

How do you insert ‘x’ at index 1 in list ‘L’?

20 / 50

What is the output of len([10, 20, 30])?

21 / 50

Which method removes and returns the last element of a list?

22 / 50

How do you access the first element of list ‘L’?

23 / 50

What is the result of [1, 2] + [3, 4]?

24 / 50

Which method adds an element to the end of a list?

25 / 50

How do you create an empty list?

26 / 50

Which method returns the title cased version of a string?

27 / 50

What is the result of ‘Data’.index(‘a’, 2)?

28 / 50

How to check if a string starts with ‘He’?

29 / 50

What is the output of ‘count’.count(‘t’)?

30 / 50

Which slice returns the whole string ‘s’ reversed?

31 / 50

What does ‘ ‘.isspace() return?

32 / 50

What is the output of ‘test’ == ‘TEST’?

33 / 50

How do you find the index of the first ‘o’ in ‘banana’?

34 / 50

What does ‘123’.isdigit() return?

35 / 50

What is the result of ‘hello’.capitalize()?

36 / 50

Which function converts a list of strings into one string?

37 / 50

What is the output of ‘Python’.lower()?

38 / 50

How do you get the last character of string ‘s’?

39 / 50

What is the result of ‘1,2,3’.split(‘,’)?

40 / 50

Which method replaces a substring with another?

41 / 50

What is the output of ‘apple’.find(‘p’)?

42 / 50

Strings in Python are mutable.

43 / 50

How do you check if ‘a’ is in string ‘s’?

44 / 50

What does ‘Python’ * 2 produce?

45 / 50

Which method removes whitespace from both ends of a string?

46 / 50

What is the output of ‘hello'[1:4]?

47 / 50

How do you get the length of a string ‘s’?

48 / 50

What is the result of ‘abc’ + ‘def’?

49 / 50

Which method converts a string to all uppercase?

50 / 50

What is the output of print(‘Python'[1])?

Your score is

The average score is 0%

Scroll to Top