Intro to Engineering: Strings, Tuples, and Lists

0.0(0)
studied byStudied by 0 people
0.0(0)
call with kaiCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

35 Terms

1
New cards

lists

the one sequence that is mutable

2
New cards

“““

how to do multiline strings

3
New cards

strings have ___ around them

4
New cards

first character

print(word[0]) prints the ____ ____ in a string

5
New cards

last character

print(word[-1]) prints the ___ ___ in a string

6
New cards

length

print(len(word)) prints the ____ of a string

7
New cards

0

a sequence always starts with ___

8
New cards

uppercase

print(text.upper()) prints a string in ____

9
New cards

lowercase

print(text.lower()) prints a string in ____

10
New cards

first

print(text.title()) capitalizes the ___ character of each word in a string

11
New cards

string

print(text.replace("o", "0")) replaces characters in a ___

12
New cards

character

print(text.count("l")) counts how many of a ____ are in a sequence

13
New cards

whitespace

print(text.split()) splits strings on the _____

14
New cards

true, false

print("World" in text) checks if characters are in the sequence and prints _____ or ____

15
New cards

immutable

tuples are ____

16
New cards

()

tuples use ____

17
New cards

comma

single-item tuples need a ___ inside the parentheses after the character

18
New cards

true, false

print("red" in colors) would result in ___ or ____

19
New cards

end

print(colors + ("yellow",)) would add yellow to the ___ of the sequence

20
New cards

[]

lists use ____

21
New cards

count

print(fruits.count("apple")) would ___ how many apples are in the list

22
New cards

replace

colors[1] = "yellow" would ____ that term with yellow in a list

23
New cards

add, end

colors.append("purple") would ____ purple to the ___ of the list

24
New cards

insert

colors.insert(0, "pink") would ___ pink at that position in a list

25
New cards

first

colors.remove("blue") would remove the ___ occurrence of blue in a list

26
New cards

remove, return, last

removed = colors.pop() would ___ and ____ the value of the ___ item

27
New cards

first

print(text[0:4]) would print the ____ four characters in a sequence

28
New cards

last

slicing does not include the ___ item

29
New cards

true, false

print("gram" in "Programming") would print ____ or ____

30
New cards

true

print(3 in [1, 2, 3, 4]) would print ___

31
New cards

true, at least

print(email.count("@") >= 1) would print ___ because email has ____ ___ 1 @

32
New cards

Hello World

print("Hello" + " " + "World") would print ___ ___

33
New cards

concatenation

print([1, 2] + [3, 4]) is an example of

34
New cards

[1, 2, 3, 4]

print([1, 2] + [3, 4]) would print ____

35
New cards

upperNames = [] initializes a new empty list called upperNames